Re: [Pdl-general] rotate matrix
Dear all, I know I join late to the discussion, let me just point to the excellent PDL::Transform module, which I have used successfully to perform rotations in the past. May be using t_linear can save you several headaches - or not. Currently, I lack time to delve into your specific problem. Ingo On 10/16/23 20:14, Luis Mochan wrote: On Sun, Oct 15, 2023 at 05:26:12PM -0700, Mark NanoNebulas wrote: ... could you put the Rotxz into 4178 dimensions I dont understand how your doing it in 3 The rotation matrix is a 3x3 matrix. It can operate on a column vector (1x3 matrix) or on many column vectors at once (on an Nx3 ndarray) or even on a multidimensional ndarray of dimensions Nx3xPxQ (The second dimension must be 3). Regards, Luis ___ pdl-general mailing list pdl-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pdl-general
Re: [Pdl-general] rotate matrix
On Sun, Oct 15, 2023 at 05:26:12PM -0700, Mark NanoNebulas wrote: > ... > could you put the Rotxz into 4178 dimensions I dont understand how your > doing it in 3 The rotation matrix is a 3x3 matrix. It can operate on a column vector (1x3 matrix) or on many column vectors at once (on an Nx3 ndarray) or even on a multidimensional ndarray of dimensions Nx3xPxQ (The second dimension must be 3). Regards, Luis -- o W. Luis Mochán, | tel:(52)(777)329-1734 /<(*) Instituto de Ciencias Físicas, UNAM | fax:(52)(777)317-5388 `>/ /\ Av. Universidad s/n CP 62210 | (*)/\/ \ Cuernavaca, Morelos, México | moc...@fis.unam.mx /\_/\__/ GPG: 791EB9EB, C949 3F81 6D9B 1191 9A16 C2DF 5F0A C52B 791E B9EB ___ pdl-general mailing list pdl-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pdl-general
Re: [Pdl-general] rotate matrix
here is the big orbitals and all there combinations, I also would like to show you that $n is important( I noticed you took it out) in that it can give you all the colors... $Best, -Mark Baker use PDL; use PDL::Complex; use PDL::Graphics::TriD; use PDL::NiceSlice; use PDL::Math; keeptwiddling3d; $PDL::BIGPDL=1; ## remember this can crash the computer if you dont have enough RAM and swap in linux or pagefile in windows for (;;){ $c = (4) ; ## speed for $phase(-360..360) { ## 360 $phases = $phase*0.001; $frequency = ($c**-1); $n= (6.28*$c*$frequency+($phases)); $photons = 4178; ### [Density] 2444 4178 $t=rvals(exp(zeros($photons))); $cz=-1**$t*$c; # -1**$t*$c $cy=-1**sin($t*$c); #-1**$c*sin($t*$c) $cx=-1**$c*sin(rvals($t))*$c; #-1**$c*bessj0(rvals($t,{Centre=>[0]}))*$c; $w=$cz-$cy-$cx; $g=sin($w); #sin $r=cos($cy+$c+$cz); #cos $b=cos($w); #cos $i=($cz-$cx-$cy); $q=$c*($i*$n); ### altitude longitude latitude $x = $b*sin($q); ### cos change the spin of the electron here $y = $r*cos($q); ### sin $z = $g*sin($q); ### cos $rad=sum(sqrt(($x**2)+($y**2)+($z**2))); $theta= sin($y*$x*$z)**-1; $phi=cos($z*$rad)->rvals; $x = $rad*cos($theta)*sin($phi); ### cos change the spin of the electron here $y = $rad*sin($theta)*sin($phi); ### sin $z = $rad*cos($phi); ### cos $xx = $b*sin($b); ### cos change the spin of the electron here $yy = $r*($q); ### sin $zz = $g*cos($g); ### cos $dd++; ## torus #$xxx = $xx*sin($yy)*cos($zz); ### cos change the spin of the electron here #$yyy = $xx*cos($yy)*cos($zz); ### sin #$zzz = $xx*sin($zz); ### cos # Draw a line ### d orbital i think $ = $xx*sin($yy)*cos($zz)+$xx; ### cos change the spin of the electron here $ = $xx*cos($yy)*cos($zz)+$xx; ### sin $ = $xx*sin($zz); ### cos # Draw a line p orbital $xxx = $xx*cos($yy)*sin($zz); ### cos change the spin of the electron here $yyy = $xx*sin($yy)*sin($zz); ### sin $zzz = $xx*cos($zz); $vv=sequence(4178); ### wavefunction #exp(-sqrt(($x**2)+($y**2)+($z**2))) #$xxx=rotate($xxx,$phase); #$yyy=rotate($yyy,$phase); #$zzz=rotate($zzz,$phase); #$xxx=$xxx*$vv; #$yyy=$yyy*$vv; #$zzz=$zzz*$vv; #$=$*$vv; #$=$*$vv; #$=$*$vv; $matrixa = ones(100); $matrixb = ones(100); $matrixc = ones(100); $colora = ones(100); $colorb = ones(100); $colorc = ones(100); # # changing the colors can show the second electron in orbit $matrixa->range(5000,[4178]) .=(($))-.2 ; $matrixb->range(5000,[4178]) .=((-$))-.2 ; $matrixc->range(5000,[4178]) .=(($))-.2 ; $colora->range(5000,[4178]) .= $r+$n ; $colorb->range(5000,[4178]) .= $g+$n ; $colorc->range(5000,[4178]) .= $b+$n ; $matrixa->range(1,[4178]) .=((-$))-.2 ; $matrixb->range(1,[4178]) .=(($))-.2 ; $matrixc->range(1,[4178]) .=((-$))-.2 ; $colora->range(1,[4178]) .= $r+$n ; $colorb->range(1,[4178]) .= $g+$n ; $colorc->range(1,[4178]) .= $b+$n ; $matrixa->range(15000,[4178]) .=((-$))-.2 ; $matrixb->range(15000,[4178]) .=(($))-.2 ; $matrixc->range(15000,[4178]) .=(($))-.2 ; $colora->range(15000,[4178]) .= $r-$n ; $colorb->range(15000,[4178]) .= $g-$n ; $colorc->range(15000,[4178]) .= $b+$n ; $matrixa->range(2,[4178]) .=(($))-.2 ; $matrixb->range(2,[4178]) .=((-$))-.2 ; $matrixc->range(2,[4178]) .=((-$))-.2 ; $colora->range(2,[4178]) .= $r-$n ; $colorb->range(2,[4178]) .= $g-$n ; $colorc->range(2,[4178]) .= $b+$n ; $matrixa->range(25000,[4178]) .=((-$))-.2 ; $matrixb->range(25000,[4178]) .=(($))-.2 ; $matrixc->range(25000,[4178]) .=(($))-.2 ; $colora->range(25000,[4178]) .= $r+$n ; $colorb->range(25000,[4178]) .= $g-$n ; $colorc->range(25000,[4178]) .= $b-$n ; $matrixa->range(3,[4178]) .=(($))-.2 ; $matrixb->range(3,[4178]) .=((-$))-.2 ; $matrixc->range(3,[4178]) .=((-$))-.2 ; $colora->range(3,[4178]) .= $r+$n ; $colorb->range(3,[4178]) .= $g-$n ; $colorc->range(3,[4178]) .= $b-$n ; $matrixa->range(35000,[4178]) .=(($))-.2 ; $matrixb->range(35000,[4178]) .=((-$))-.2 ; $matrixc->range(35000,[4178]) .=((-$))-.2 ; $colora->range(35000,[4178]) .= $r-$n ; $colorb->range(35000,[4178]) .= $g+$n ; $colorc->range(35000,[4178]) .= $b+$n ; $matrixa->range(4,[4178]) .=((-$))-.2 ; $matrixb->range(4,[4178]) .=(($))-.2 ; $matrixc->range(4,[4178]) .=(($))-.2 ; $colora->range(4,[4178]) .= $r-$n ; $colorb->range(4,[4178]) .= $g+$n ; $colorc->range(4,[4178]) .= $b+$n ; $matrixa->range(45000,[4178]) .=(($))-.2 ; $matrixb->range(45000,[4178]) .=(($))-.2 ; $matrixc->range(45000,[4178]) .=(($))-.2 ; $colora->range(45000,[4178]) .= $r+$n ; $colorb->range(45000,[4178]) .= $g+$n ;
Re: [Pdl-general] rotate matrix
i found the torus matrix here $xxx = $xx*sin($yy)*cos($zz); $yyy = $xx*cos($yy)*cos($zz); $zzz = $xx*sin($zz); and if you add the $xx to $xxx and $yyy you get bigger orbs like $xxx = $xx*sin($yy)*cos($zz)+$xx; $yyy = $xx*cos($yy)*cos($zz)+$xx; $zzz = $xx*sin($zz); would that be all the orbitals i need ??? Best, -Mark Baker On Sun, Oct 15, 2023 at 5:46 PM Mark NanoNebulas wrote: > the s orbital is x y z the p orbital is the d orbitals are > xxx yyy zzz > is that right and can they be used to describe all atoms ??? > > -Mark Baker > > On Sun, Oct 15, 2023 at 5:26 PM Mark NanoNebulas > wrote: > >> have you used the range function ??? here i have all orbitals that can >> be without using hold3d(); >> >> could you put the Rotxz into 4178 dimensions I dont understand how your >> doing it in 3 >> here are all the orbitals i got 14 of them total in your opinion can i >> use these to describe all the atoms >> >> check out the range function it lets you use a lot of piddles in one >> matrix... >> >> Best, >> -Mark >> # >> >> use PDL; >> use PDL::Complex; >> use PDL::Graphics::TriD; >> use PDL::NiceSlice; >> use PDL::Math; keeptwiddling3d; >> $PDL::BIGPDL=1; >> ## remember this can crash the computer if you dont have enough RAM and >> swap in linux or pagefile in windows >> >> >> >> for (;;){ >> $c = (4000) ; ## speed >> for $phase(-360..360) { ## 360 >> $phases = $phase*0.001; >> $frequency = ($c**-1); >> $n= (6.28*$c*$frequency+($phases)); >> >> $photons = 4178; ### [Density] 2444 4178 >> >> >> $t=rvals(exp(zeros($photons))); >> $cz=-1**$t*$c; # -1**$t*$c >> $cy=-1**sin($t*$c); #-1**$c*sin($t*$c) >> $cx=-1**$c*sin(rvals($t))*$c; #-1**$c*bessj0(rvals($t,{Centre=>[0]}))*$c; >> >> >> $w=$cz-$cy-$cx; >> $g=sin($w); #sin >> $r=cos($cy+$c+$cz); #cos >> $b=cos($w); #cos >> $i=($cz-$cx-$cy); >> $q=$c*($i*$n); >> >> ### altitude longitude latitude >> $x = $b*sin($q); ### cos change the spin of the electron here >> $y = $r*cos($q); ### sin >> $z = $g*sin($q); ### cos >> >> >> $xx = $b*sin($b); ### cos change the spin of the electron here >> $yy = $r*($q); ### sin >> $zz = $g*cos($g); ### cos >> $dd++; >> $xxx = $xx*cos($yy)*sin($zz)+sin($xx*(1/sqrt 2)); ### cos change the >> spin of the electron here >> $yyy = $xx*sin($yy)*sin($zz)+sin($xx*(1/sqrt 2)); ### sin >> $zzz = $xx*cos($zz); ### cos >> # Draw a line >> >> $ = $xx*cos($yy)*sin($zz); ### cos change the spin of the electron >> here >> $ = $xx*sin($yy)*sin($zz); ### sin >> $ = $xx*cos($zz); >> >> >> >> $vv=sequence(4178); >> ### wavefunction #exp(-sqrt(($x**2)+($y**2)+($z**2))) >> >> #$xxx=rotate($xxx,$phase); >> #$yyy=rotate($yyy,$phase); >> #$zzz=rotate($zzz,$phase); >> >> #$xxx=$xxx*$vv; >> #$yyy=$yyy*$vv; >> #$zzz=$zzz*$vv; >> >> #$=$*$vv; >> #$=$*$vv; >> #$=$*$vv; >> >> >> >> >> $matrixa = ones(100); >> $matrixb = ones(100); >> $matrixc = ones(100); >> $colora = ones(100); >> $colorb = ones(100); >> $colorc = ones(100); >> >> $matrixa->range(5000,[4178]) .=0.8*(($xxx))-.2 ; >> $matrixb->range(5000,[4178]) .=0.8*(($yyy))-.2 ; >> $matrixc->range(5000,[4178]) .=0.8*(($zzz))-.2 ; >> $colora->range(5000,[4178]) .= $r ; >> $colorb->range(5000,[4178]) .= $g ; >> $colorc->range(5000,[4178]) .= $b ; >> >> $matrixa->range(1,[4178]) .=0.8*((-$xxx))-.2 ; >> $matrixb->range(1,[4178]) .=0.8*((-$yyy))-.2 ; >> $matrixc->range(1,[4178]) .=0.8*((-$zzz))-.2 ; >> $colora->range(1,[4178]) .= $r ; >> $colorb->range(1,[4178]) .= $g ; >> $colorc->range(1,[4178]) .= $b ; >> >>$matrixa->range(15000,[4178]) .=0.8*((-$xxx))-.2 ; >> $matrixb->range(15000,[4178]) .=0.8*((-$yyy))-.2 ; >> $matrixc->range(15000,[4178]) .=0.8*(($zzz))-.2 ; >> $colora->range(15000,[4178]) .= $r ; >> $colorb->range(15000,[4178]) .= $g ; >> $colorc->range(15000,[4178]) .= $b ; >> >> $matrixa->range(2,[4178]) .=0.8*(($xxx))-.2 ; >> $matrixb->range(2,[4178]) .=0.8*((-$yyy))-.2 ; >> $matrixc->range(2,[4178]) .=0.8*(($zzz))-.2 ; >> $colora->range(2,[4178]) .= $r ; >> $colorb->range(2,[4178]) .= $g ; >> $colorc->range(2,[4178]) .= $b ; >> >>$matrixa->range(25000,[4178]) .=0.8*((-$xxx))-.2 ; >> $matrixb->range(25000,[4178]) .=0.8*(($yyy))-.2 ; >> $matrixc->range(25000,[4178]) .=0.8*((-$zzz))-.2 ; >> $colora->range(25000,[4178]) .= $r ; >> $colorb->range(25000,[4178]) .= $g ; >> $colorc->range(25000,[4178]) .= $b ; >> >>$matrixa->range(3,[4178]) .=0.8*(($xxx))-.2 ; >> $matrixb->range(3,[4178]) .=0.8*((-$yyy))-.2 ; >> $matrixc->range(3,[4178]) .=0.8*((-$zzz))-.2 ; >> $colora->range(3,[4178]) .= $r ; >> $colorb->range(3,[4178]) .= $g ; >> $colorc->range(3,[4178]) .= $b ; >> >> $matrixa->range(35000,[4178]) .=0.8*(($xxx))-.2 ; >> $matrixb->range(35000,[4178]) .=0.8*(($yyy))-.2 ; >>
Re: [Pdl-general] rotate matrix
the s orbital is x y z the p orbital is the d orbitals are xxx yyy zzz is that right and can they be used to describe all atoms ??? -Mark Baker On Sun, Oct 15, 2023 at 5:26 PM Mark NanoNebulas wrote: > have you used the range function ??? here i have all orbitals that can be > without using hold3d(); > > could you put the Rotxz into 4178 dimensions I dont understand how your > doing it in 3 > here are all the orbitals i got 14 of them total in your opinion can i use > these to describe all the atoms > > check out the range function it lets you use a lot of piddles in one > matrix... > > Best, > -Mark > # > > use PDL; > use PDL::Complex; > use PDL::Graphics::TriD; > use PDL::NiceSlice; > use PDL::Math; keeptwiddling3d; > $PDL::BIGPDL=1; > ## remember this can crash the computer if you dont have enough RAM and > swap in linux or pagefile in windows > > > > for (;;){ > $c = (4000) ; ## speed > for $phase(-360..360) { ## 360 > $phases = $phase*0.001; > $frequency = ($c**-1); > $n= (6.28*$c*$frequency+($phases)); > > $photons = 4178; ### [Density] 2444 4178 > > > $t=rvals(exp(zeros($photons))); > $cz=-1**$t*$c; # -1**$t*$c > $cy=-1**sin($t*$c); #-1**$c*sin($t*$c) > $cx=-1**$c*sin(rvals($t))*$c; #-1**$c*bessj0(rvals($t,{Centre=>[0]}))*$c; > > > $w=$cz-$cy-$cx; > $g=sin($w); #sin > $r=cos($cy+$c+$cz); #cos > $b=cos($w); #cos > $i=($cz-$cx-$cy); > $q=$c*($i*$n); > > ### altitude longitude latitude > $x = $b*sin($q); ### cos change the spin of the electron here > $y = $r*cos($q); ### sin > $z = $g*sin($q); ### cos > > > $xx = $b*sin($b); ### cos change the spin of the electron here > $yy = $r*($q); ### sin > $zz = $g*cos($g); ### cos > $dd++; > $xxx = $xx*cos($yy)*sin($zz)+sin($xx*(1/sqrt 2)); ### cos change the > spin of the electron here > $yyy = $xx*sin($yy)*sin($zz)+sin($xx*(1/sqrt 2)); ### sin > $zzz = $xx*cos($zz); ### cos > # Draw a line > > $ = $xx*cos($yy)*sin($zz); ### cos change the spin of the electron > here > $ = $xx*sin($yy)*sin($zz); ### sin > $ = $xx*cos($zz); > > > > $vv=sequence(4178); > ### wavefunction #exp(-sqrt(($x**2)+($y**2)+($z**2))) > > #$xxx=rotate($xxx,$phase); > #$yyy=rotate($yyy,$phase); > #$zzz=rotate($zzz,$phase); > > #$xxx=$xxx*$vv; > #$yyy=$yyy*$vv; > #$zzz=$zzz*$vv; > > #$=$*$vv; > #$=$*$vv; > #$=$*$vv; > > > > > $matrixa = ones(100); > $matrixb = ones(100); > $matrixc = ones(100); > $colora = ones(100); > $colorb = ones(100); > $colorc = ones(100); > > $matrixa->range(5000,[4178]) .=0.8*(($xxx))-.2 ; > $matrixb->range(5000,[4178]) .=0.8*(($yyy))-.2 ; > $matrixc->range(5000,[4178]) .=0.8*(($zzz))-.2 ; > $colora->range(5000,[4178]) .= $r ; > $colorb->range(5000,[4178]) .= $g ; > $colorc->range(5000,[4178]) .= $b ; > > $matrixa->range(1,[4178]) .=0.8*((-$xxx))-.2 ; > $matrixb->range(1,[4178]) .=0.8*((-$yyy))-.2 ; > $matrixc->range(1,[4178]) .=0.8*((-$zzz))-.2 ; > $colora->range(1,[4178]) .= $r ; > $colorb->range(1,[4178]) .= $g ; > $colorc->range(1,[4178]) .= $b ; > >$matrixa->range(15000,[4178]) .=0.8*((-$xxx))-.2 ; > $matrixb->range(15000,[4178]) .=0.8*((-$yyy))-.2 ; > $matrixc->range(15000,[4178]) .=0.8*(($zzz))-.2 ; > $colora->range(15000,[4178]) .= $r ; > $colorb->range(15000,[4178]) .= $g ; > $colorc->range(15000,[4178]) .= $b ; > > $matrixa->range(2,[4178]) .=0.8*(($xxx))-.2 ; > $matrixb->range(2,[4178]) .=0.8*((-$yyy))-.2 ; > $matrixc->range(2,[4178]) .=0.8*(($zzz))-.2 ; > $colora->range(2,[4178]) .= $r ; > $colorb->range(2,[4178]) .= $g ; > $colorc->range(2,[4178]) .= $b ; > >$matrixa->range(25000,[4178]) .=0.8*((-$xxx))-.2 ; > $matrixb->range(25000,[4178]) .=0.8*(($yyy))-.2 ; > $matrixc->range(25000,[4178]) .=0.8*((-$zzz))-.2 ; > $colora->range(25000,[4178]) .= $r ; > $colorb->range(25000,[4178]) .= $g ; > $colorc->range(25000,[4178]) .= $b ; > >$matrixa->range(3,[4178]) .=0.8*(($xxx))-.2 ; > $matrixb->range(3,[4178]) .=0.8*((-$yyy))-.2 ; > $matrixc->range(3,[4178]) .=0.8*((-$zzz))-.2 ; > $colora->range(3,[4178]) .= $r ; > $colorb->range(3,[4178]) .= $g ; > $colorc->range(3,[4178]) .= $b ; > > $matrixa->range(35000,[4178]) .=0.8*(($xxx))-.2 ; > $matrixb->range(35000,[4178]) .=0.8*(($yyy))-.2 ; > $matrixc->range(35000,[4178]) .=0.8*((-$zzz))-.2 ; > $colora->range(35000,[4178]) .= $r ; > $colorb->range(35000,[4178]) .= $g ; > $colorc->range(35000,[4178]) .= $b ; > > $matrixa->range(4,[4178]) .=0.8*((-$xxx))-.2 ; > $matrixb->range(4,[4178]) .=0.8*(($yyy))-.2 ; > $matrixc->range(4,[4178]) .=0.8*(($zzz))-.2 ; > $colora->range(4,[4178]) .= $r ; > $colorb->range(4,[4178]) .= $g ; > $colorc->range(4,[4178]) .= $b ; > > $matrixa->range(45000,[4178]) .=(($))-.2 ; > $matrixb->range(45000,[4178]) .=(($))-.2 ; >
Re: [Pdl-general] rotate matrix
have you used the range function ??? here i have all orbitals that can be without using hold3d(); could you put the Rotxz into 4178 dimensions I dont understand how your doing it in 3 here are all the orbitals i got 14 of them total in your opinion can i use these to describe all the atoms check out the range function it lets you use a lot of piddles in one matrix... Best, -Mark # use PDL; use PDL::Complex; use PDL::Graphics::TriD; use PDL::NiceSlice; use PDL::Math; keeptwiddling3d; $PDL::BIGPDL=1; ## remember this can crash the computer if you dont have enough RAM and swap in linux or pagefile in windows for (;;){ $c = (4000) ; ## speed for $phase(-360..360) { ## 360 $phases = $phase*0.001; $frequency = ($c**-1); $n= (6.28*$c*$frequency+($phases)); $photons = 4178; ### [Density] 2444 4178 $t=rvals(exp(zeros($photons))); $cz=-1**$t*$c; # -1**$t*$c $cy=-1**sin($t*$c); #-1**$c*sin($t*$c) $cx=-1**$c*sin(rvals($t))*$c; #-1**$c*bessj0(rvals($t,{Centre=>[0]}))*$c; $w=$cz-$cy-$cx; $g=sin($w); #sin $r=cos($cy+$c+$cz); #cos $b=cos($w); #cos $i=($cz-$cx-$cy); $q=$c*($i*$n); ### altitude longitude latitude $x = $b*sin($q); ### cos change the spin of the electron here $y = $r*cos($q); ### sin $z = $g*sin($q); ### cos $xx = $b*sin($b); ### cos change the spin of the electron here $yy = $r*($q); ### sin $zz = $g*cos($g); ### cos $dd++; $xxx = $xx*cos($yy)*sin($zz)+sin($xx*(1/sqrt 2)); ### cos change the spin of the electron here $yyy = $xx*sin($yy)*sin($zz)+sin($xx*(1/sqrt 2)); ### sin $zzz = $xx*cos($zz); ### cos # Draw a line $ = $xx*cos($yy)*sin($zz); ### cos change the spin of the electron here $ = $xx*sin($yy)*sin($zz); ### sin $ = $xx*cos($zz); $vv=sequence(4178); ### wavefunction #exp(-sqrt(($x**2)+($y**2)+($z**2))) #$xxx=rotate($xxx,$phase); #$yyy=rotate($yyy,$phase); #$zzz=rotate($zzz,$phase); #$xxx=$xxx*$vv; #$yyy=$yyy*$vv; #$zzz=$zzz*$vv; #$=$*$vv; #$=$*$vv; #$=$*$vv; $matrixa = ones(100); $matrixb = ones(100); $matrixc = ones(100); $colora = ones(100); $colorb = ones(100); $colorc = ones(100); $matrixa->range(5000,[4178]) .=0.8*(($xxx))-.2 ; $matrixb->range(5000,[4178]) .=0.8*(($yyy))-.2 ; $matrixc->range(5000,[4178]) .=0.8*(($zzz))-.2 ; $colora->range(5000,[4178]) .= $r ; $colorb->range(5000,[4178]) .= $g ; $colorc->range(5000,[4178]) .= $b ; $matrixa->range(1,[4178]) .=0.8*((-$xxx))-.2 ; $matrixb->range(1,[4178]) .=0.8*((-$yyy))-.2 ; $matrixc->range(1,[4178]) .=0.8*((-$zzz))-.2 ; $colora->range(1,[4178]) .= $r ; $colorb->range(1,[4178]) .= $g ; $colorc->range(1,[4178]) .= $b ; $matrixa->range(15000,[4178]) .=0.8*((-$xxx))-.2 ; $matrixb->range(15000,[4178]) .=0.8*((-$yyy))-.2 ; $matrixc->range(15000,[4178]) .=0.8*(($zzz))-.2 ; $colora->range(15000,[4178]) .= $r ; $colorb->range(15000,[4178]) .= $g ; $colorc->range(15000,[4178]) .= $b ; $matrixa->range(2,[4178]) .=0.8*(($xxx))-.2 ; $matrixb->range(2,[4178]) .=0.8*((-$yyy))-.2 ; $matrixc->range(2,[4178]) .=0.8*(($zzz))-.2 ; $colora->range(2,[4178]) .= $r ; $colorb->range(2,[4178]) .= $g ; $colorc->range(2,[4178]) .= $b ; $matrixa->range(25000,[4178]) .=0.8*((-$xxx))-.2 ; $matrixb->range(25000,[4178]) .=0.8*(($yyy))-.2 ; $matrixc->range(25000,[4178]) .=0.8*((-$zzz))-.2 ; $colora->range(25000,[4178]) .= $r ; $colorb->range(25000,[4178]) .= $g ; $colorc->range(25000,[4178]) .= $b ; $matrixa->range(3,[4178]) .=0.8*(($xxx))-.2 ; $matrixb->range(3,[4178]) .=0.8*((-$yyy))-.2 ; $matrixc->range(3,[4178]) .=0.8*((-$zzz))-.2 ; $colora->range(3,[4178]) .= $r ; $colorb->range(3,[4178]) .= $g ; $colorc->range(3,[4178]) .= $b ; $matrixa->range(35000,[4178]) .=0.8*(($xxx))-.2 ; $matrixb->range(35000,[4178]) .=0.8*(($yyy))-.2 ; $matrixc->range(35000,[4178]) .=0.8*((-$zzz))-.2 ; $colora->range(35000,[4178]) .= $r ; $colorb->range(35000,[4178]) .= $g ; $colorc->range(35000,[4178]) .= $b ; $matrixa->range(4,[4178]) .=0.8*((-$xxx))-.2 ; $matrixb->range(4,[4178]) .=0.8*(($yyy))-.2 ; $matrixc->range(4,[4178]) .=0.8*(($zzz))-.2 ; $colora->range(4,[4178]) .= $r ; $colorb->range(4,[4178]) .= $g ; $colorc->range(4,[4178]) .= $b ; $matrixa->range(45000,[4178]) .=(($))-.2 ; $matrixb->range(45000,[4178]) .=(($))-.2 ; $matrixc->range(45000,[4178]) .=(($))-.2 ; $colora->range(45000,[4178]) .= $r ; $colorb->range(45000,[4178]) .= $g ; $colorc->range(45000,[4178]) .= $b ; $matrixa->range(5,[4178]) .=((-$))-.2 ; $matrixb->range(5,[4178]) .=((-$))-.2 ; $matrixc->range(5,[4178]) .=((-$))-.2 ; $colora->range(5,[4178]) .= $r ; $colorb->range(5,[4178]) .= $g ; $colorc->range(5,[4178]) .= $b ; $matrixa->range(55000,[4178]) .=(($))-.2 ;
Re: [Pdl-general] rotate matrix
This worked for me to generate x-z d orbitals. The other planes are similar. I simply applied 4 different 45 degree rotations to your points and plotted them all together. I added two additional points to fix the scale. ## use PDL; use PDL::Complex; use PDL::Graphics::TriD; use PDL::Math; my $c = 10; ## speed my $Rotxz=pdl([[1/sqrt 2, 0, -1/sqrt 2],[0,1,0], [1/sqrt 2, 0, 1/sqrt 2]]); nokeeptwiddling3d; while(1){ for my $phase(-360..360) { ## 360 my $photons = 4178; ### [Density] 2444 4178 my $t=rvals(zeros($photons)); my $cz=$c; # -1**$t*$c my $cy=sin($t*$c); my $cx=sin($t)*$c; my $w=$cz-$cy-$cx; my $color=(pdl[my $r=cos($cy+$c+$cz), my $g=sin($w), my $b=cos($w)])->mv(-1,0); my $i=($cz-$cx-$cy); my $q=$c*($i*$phase); my $R = $b*sin($b); my $phi = $r*$q; my $theta = $g*cos($g); my $points=($R*pdl[sin($theta)*cos($phi), sin($phi)*sin($theta),cos($theta)]); my $allpoints=pdl( $Rotxz x $points, $Rotxz->transpose x $points, -$Rotxz x $points, -$Rotxz->transpose x $points )->mv(1,0); points3d(pdl[[1,1,1],[-1,-1,-1]]); hold3d(); points3d($allpoints, $color->dummy(2)); release3d(); } } On Sat, Oct 14, 2023 at 06:01:34PM -0700, Mark NanoNebulas wrote: > i found out how to move the point in the y axis here > $dd++; > $xxx = $xx*cos($yy)*sin($zz)+sin($xx); ### cos change the spin of the > electron here > $yyy = $xx*sin($yy)*sin($zz)+sin($xx+$dd); ### sin > $zzz = $xx*cos($zz); ### cos > > this seems to work but can it make all the d orbitals i need ??? > > -Mark Baker > > > On Sat, Oct 14, 2023 at 7:18 AM Luis Mochan wrote: > > > Hi, > > I didn't quite understand the code. I simplified it a bit, removed > > many noop instructions, changed the speed, negated the twiddling and > > the result looks like a nice lobe of a p orbital, made up of points > > along some spiral, rotating about its axis. Is this the rotation you > > want or do you want to rotate the symmetry axis from the z direction to an > > arbitrary direction? You could apply a 3x3 rotation matrix to the > > $points array in the code below. If you want a point to remain fixed, > > first translate it to the origin, the rotate, and then rotate back. > > Regards, > > Luis > > > > ## > > use PDL; > > use PDL::Complex; > > use PDL::Graphics::TriD; > > use PDL::Math; > > nokeeptwiddling3d; > > my $c = 10; ## speed > > while(1){ > > for my $phase(-360..360) { ## 360 > > my $photons = 4178; ### [Density] 2444 4178 > > my $t=rvals(zeros($photons)); > > my $cz=$c; # -1**$t*$c > > my $cy=sin($t*$c); > > my $cx=sin($t)*$c; > > my $w=$cz-$cy-$cx; > > my $color=(pdl[my $r=cos($cy+$c+$cz), my $g=sin($w), my > > $b=cos($w)])->mv(-1,0); > > my $i=($cz-$cx-$cy); > > my $q=$c*($i*$phase); > > my $R = $b*sin($b); > > my $phi = $r*$q; > > my $theta = $g*cos($g); > > my $points=($R*pdl[sin($theta)*cos($phi), > > sin($phi)*sin($theta),cos($theta)])->mv(-1,0); > > points3d $points,$color; > > } > > } > > > > > > > > On Fri, Oct 13, 2023 at 10:36:17AM -0700, Mark NanoNebulas wrote: > > > Hi im trying to rotate this obital so that i can place them all over in > > > balanced arrangements of orbs like the chemistry book says but i dont > > know > > > how to rotate a matrix in all directions, can anybody help > > > heres the code > > > > > > ## > > > use PDL; > > > use PDL::Complex; > > > use PDL::Graphics::TriD; > > > use PDL::Math; keeptwiddling3d; > > > $PDL::BIGPDL=1; > > > ## remember this can crash the computer if you dont have enough RAM and > > > swap in linux or pagefile in windows > > > > > > > > > > > > for (;;){ > > > $c = (400) ; ## speed > > > for $phase(-360..360) { ## 360 > > > $phases = $phase*0.001; > > > $frequency = ($c**-1); > > > $n= (6.28*$c*$frequency+($phases)); > > > > > > $photons = 4178; ### [Density] 2444 4178 > > > > > > > > > $t=rvals(exp(zeros($photons))); > > > $cz=-1**$t*$c; # -1**$t*$c > > > $cy=-1**sin($t*$c); #-1**$c*sin($t*$c) > > > $cx=-1**$c*sin(rvals($t))*$c; > > #-1**$c*bessj0(rvals($t,{Centre=>[0]}))*$c; > > > > > > > > > $w=$cz-$cy-$cx; > > > $g=sin($w); #sin > > > $r=cos($cy+$c+$cz); #cos > > > $b=cos($w); #cos > > > $i=($cz-$cx-$cy); > > > $q=$c*($i*$n); > > > $xx = $b*sin($b); ### > > > $yy = $r*($q); ### > > > $zz = $g*cos($g); ### > > > > > > $xxx = $xx*cos($yy)*sin($zz); ### > > > $yyy = $xx*sin($yy)*sin($zz); ### > > > $zzz = $xx*cos($zz); > > > > > > points3d[$xxx,$yyy,$zzz],[$r,$g,$b]; > > > > > > ## > > > > > > if i can get this orbital to rotate in all directions, then i can >
Re: [Pdl-general] rotate matrix
i found out how to move the point in the y axis here $dd++; $xxx = $xx*cos($yy)*sin($zz)+sin($xx); ### cos change the spin of the electron here $yyy = $xx*sin($yy)*sin($zz)+sin($xx+$dd); ### sin $zzz = $xx*cos($zz); ### cos this seems to work but can it make all the d orbitals i need ??? -Mark Baker On Sat, Oct 14, 2023 at 7:18 AM Luis Mochan wrote: > Hi, > I didn't quite understand the code. I simplified it a bit, removed > many noop instructions, changed the speed, negated the twiddling and > the result looks like a nice lobe of a p orbital, made up of points > along some spiral, rotating about its axis. Is this the rotation you > want or do you want to rotate the symmetry axis from the z direction to an > arbitrary direction? You could apply a 3x3 rotation matrix to the > $points array in the code below. If you want a point to remain fixed, > first translate it to the origin, the rotate, and then rotate back. > Regards, > Luis > > ## > use PDL; > use PDL::Complex; > use PDL::Graphics::TriD; > use PDL::Math; > nokeeptwiddling3d; > my $c = 10; ## speed > while(1){ > for my $phase(-360..360) { ## 360 > my $photons = 4178; ### [Density] 2444 4178 > my $t=rvals(zeros($photons)); > my $cz=$c; # -1**$t*$c > my $cy=sin($t*$c); > my $cx=sin($t)*$c; > my $w=$cz-$cy-$cx; > my $color=(pdl[my $r=cos($cy+$c+$cz), my $g=sin($w), my > $b=cos($w)])->mv(-1,0); > my $i=($cz-$cx-$cy); > my $q=$c*($i*$phase); > my $R = $b*sin($b); > my $phi = $r*$q; > my $theta = $g*cos($g); > my $points=($R*pdl[sin($theta)*cos($phi), > sin($phi)*sin($theta),cos($theta)])->mv(-1,0); > points3d $points,$color; > } > } > > > > On Fri, Oct 13, 2023 at 10:36:17AM -0700, Mark NanoNebulas wrote: > > Hi im trying to rotate this obital so that i can place them all over in > > balanced arrangements of orbs like the chemistry book says but i dont > know > > how to rotate a matrix in all directions, can anybody help > > heres the code > > > > ## > > use PDL; > > use PDL::Complex; > > use PDL::Graphics::TriD; > > use PDL::Math; keeptwiddling3d; > > $PDL::BIGPDL=1; > > ## remember this can crash the computer if you dont have enough RAM and > > swap in linux or pagefile in windows > > > > > > > > for (;;){ > > $c = (400) ; ## speed > > for $phase(-360..360) { ## 360 > > $phases = $phase*0.001; > > $frequency = ($c**-1); > > $n= (6.28*$c*$frequency+($phases)); > > > > $photons = 4178; ### [Density] 2444 4178 > > > > > > $t=rvals(exp(zeros($photons))); > > $cz=-1**$t*$c; # -1**$t*$c > > $cy=-1**sin($t*$c); #-1**$c*sin($t*$c) > > $cx=-1**$c*sin(rvals($t))*$c; > #-1**$c*bessj0(rvals($t,{Centre=>[0]}))*$c; > > > > > > $w=$cz-$cy-$cx; > > $g=sin($w); #sin > > $r=cos($cy+$c+$cz); #cos > > $b=cos($w); #cos > > $i=($cz-$cx-$cy); > > $q=$c*($i*$n); > > $xx = $b*sin($b); ### > > $yy = $r*($q); ### > > $zz = $g*cos($g); ### > > > > $xxx = $xx*cos($yy)*sin($zz); ### > > $yyy = $xx*sin($yy)*sin($zz); ### > > $zzz = $xx*cos($zz); > > > > points3d[$xxx,$yyy,$zzz],[$r,$g,$b]; > > > > ## > > > > if i can get this orbital to rotate in all directions, then i can > represent > > atoms > > better cause they are balanced by the number of electrons so the orbs > > repeal each other, please any help would be appreciated !!! > > > > Best, > > -Mark Baker > > > > ___ > > pdl-general mailing list > > pdl-general@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/pdl-general > > > -- > > o > W. Luis Mochán, | tel:(52)(777)329-1734 /<(*) > Instituto de Ciencias Físicas, UNAM | fax:(52)(777)317-5388 `>/ /\ > Av. Universidad s/n CP 62210 | (*)/\/ \ > Cuernavaca, Morelos, México | moc...@fis.unam.mx /\_/\__/ > GPG: 791EB9EB, C949 3F81 6D9B 1191 9A16 C2DF 5F0A C52B 791E B9EB > > > ___ > pdl-general mailing list > pdl-general@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/pdl-general > ___ pdl-general mailing list pdl-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pdl-general
Re: [Pdl-general] rotate matrix
Hi, I didn't quite understand the code. I simplified it a bit, removed many noop instructions, changed the speed, negated the twiddling and the result looks like a nice lobe of a p orbital, made up of points along some spiral, rotating about its axis. Is this the rotation you want or do you want to rotate the symmetry axis from the z direction to an arbitrary direction? You could apply a 3x3 rotation matrix to the $points array in the code below. If you want a point to remain fixed, first translate it to the origin, the rotate, and then rotate back. Regards, Luis ## use PDL; use PDL::Complex; use PDL::Graphics::TriD; use PDL::Math; nokeeptwiddling3d; my $c = 10; ## speed while(1){ for my $phase(-360..360) { ## 360 my $photons = 4178; ### [Density] 2444 4178 my $t=rvals(zeros($photons)); my $cz=$c; # -1**$t*$c my $cy=sin($t*$c); my $cx=sin($t)*$c; my $w=$cz-$cy-$cx; my $color=(pdl[my $r=cos($cy+$c+$cz), my $g=sin($w), my $b=cos($w)])->mv(-1,0); my $i=($cz-$cx-$cy); my $q=$c*($i*$phase); my $R = $b*sin($b); my $phi = $r*$q; my $theta = $g*cos($g); my $points=($R*pdl[sin($theta)*cos($phi), sin($phi)*sin($theta),cos($theta)])->mv(-1,0); points3d $points,$color; } } On Fri, Oct 13, 2023 at 10:36:17AM -0700, Mark NanoNebulas wrote: > Hi im trying to rotate this obital so that i can place them all over in > balanced arrangements of orbs like the chemistry book says but i dont know > how to rotate a matrix in all directions, can anybody help > heres the code > > ## > use PDL; > use PDL::Complex; > use PDL::Graphics::TriD; > use PDL::Math; keeptwiddling3d; > $PDL::BIGPDL=1; > ## remember this can crash the computer if you dont have enough RAM and > swap in linux or pagefile in windows > > > > for (;;){ > $c = (400) ; ## speed > for $phase(-360..360) { ## 360 > $phases = $phase*0.001; > $frequency = ($c**-1); > $n= (6.28*$c*$frequency+($phases)); > > $photons = 4178; ### [Density] 2444 4178 > > > $t=rvals(exp(zeros($photons))); > $cz=-1**$t*$c; # -1**$t*$c > $cy=-1**sin($t*$c); #-1**$c*sin($t*$c) > $cx=-1**$c*sin(rvals($t))*$c; #-1**$c*bessj0(rvals($t,{Centre=>[0]}))*$c; > > > $w=$cz-$cy-$cx; > $g=sin($w); #sin > $r=cos($cy+$c+$cz); #cos > $b=cos($w); #cos > $i=($cz-$cx-$cy); > $q=$c*($i*$n); > $xx = $b*sin($b); ### > $yy = $r*($q); ### > $zz = $g*cos($g); ### > > $xxx = $xx*cos($yy)*sin($zz); ### > $yyy = $xx*sin($yy)*sin($zz); ### > $zzz = $xx*cos($zz); > > points3d[$xxx,$yyy,$zzz],[$r,$g,$b]; > > ## > > if i can get this orbital to rotate in all directions, then i can represent > atoms > better cause they are balanced by the number of electrons so the orbs > repeal each other, please any help would be appreciated !!! > > Best, > -Mark Baker > ___ > pdl-general mailing list > pdl-general@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/pdl-general -- o W. Luis Mochán, | tel:(52)(777)329-1734 /<(*) Instituto de Ciencias Físicas, UNAM | fax:(52)(777)317-5388 `>/ /\ Av. Universidad s/n CP 62210 | (*)/\/ \ Cuernavaca, Morelos, México | moc...@fis.unam.mx /\_/\__/ GPG: 791EB9EB, C949 3F81 6D9B 1191 9A16 C2DF 5F0A C52B 791E B9EB ___ pdl-general mailing list pdl-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pdl-general
Re: [Pdl-general] rotate matrix
I some what found an answer i had to change the geometry to get an orb in the center position which i found to be $xxx = $xx*cos($yy)*sin($zz)+sin($xx); ### $yyy = $xx*sin($yy)*sin($zz)+sin($xx); ### $zzz = $xx*cos($zz); which all together gives 14 orbs 8 with +sin($xx) and 6 regular but the orbitals go 2 8 18 32 so the 8 is really 4 orbitals 2 electrons to each orb which makes the code only good for the s and p orbitals so would just using spheres be better $Cheers -Mark Baker On Fri, Oct 13, 2023 at 10:36 AM Mark NanoNebulas wrote: > Hi im trying to rotate this obital so that i can place them all over in > balanced arrangements of orbs like the chemistry book says but i dont know > how to rotate a matrix in all directions, can anybody help > heres the code > > ## > use PDL; > use PDL::Complex; > use PDL::Graphics::TriD; > use PDL::Math; keeptwiddling3d; > $PDL::BIGPDL=1; > ## remember this can crash the computer if you dont have enough RAM and > swap in linux or pagefile in windows > > > > for (;;){ > $c = (400) ; ## speed > for $phase(-360..360) { ## 360 > $phases = $phase*0.001; > $frequency = ($c**-1); > $n= (6.28*$c*$frequency+($phases)); > > $photons = 4178; ### [Density] 2444 4178 > > > $t=rvals(exp(zeros($photons))); > $cz=-1**$t*$c; # -1**$t*$c > $cy=-1**sin($t*$c); #-1**$c*sin($t*$c) > $cx=-1**$c*sin(rvals($t))*$c; #-1**$c*bessj0(rvals($t,{Centre=>[0]}))*$c; > > > $w=$cz-$cy-$cx; > $g=sin($w); #sin > $r=cos($cy+$c+$cz); #cos > $b=cos($w); #cos > $i=($cz-$cx-$cy); > $q=$c*($i*$n); > $xx = $b*sin($b); ### > $yy = $r*($q); ### > $zz = $g*cos($g); ### > > $xxx = $xx*cos($yy)*sin($zz); ### > $yyy = $xx*sin($yy)*sin($zz); ### > $zzz = $xx*cos($zz); > > points3d[$xxx,$yyy,$zzz],[$r,$g,$b]; > > ## > > if i can get this orbital to rotate in all directions, then i can > represent atoms > better cause they are balanced by the number of electrons so the orbs > repeal each other, please any help would be appreciated !!! > > Best, > -Mark Baker > > > > > ___ pdl-general mailing list pdl-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pdl-general