/* Persistence of Vision Ray Tracer Scene Description File File: H_Wave_Functions v4_1.pov Version: 3.5 beta-RC6 Date: 15 june 2002 Author: Jaap Frank Desc: With media one can display the various wave functions of Hydrogen. In this version the derivatives are generated by functions and can in principle be expanded for all values for n. The function that discribes all the wavefunctions of hydrogen is: r l+1 - - { v } 2 l n k { v ( n+l ) 1 ( 2r ) } U = U (r) = -------------------------- . r . e . Sigma { (-1) . ( ) . - . ( -- ) } ,with: k = n-l-1 n,l __________________ v=0 { ( k-v ) v! ( n ) } l+2 / ( n+l ) n . / (2l+1)! . ( ) V ( k ) ______________ m { l ( ) } m m /2l+1 (l-m)! imPhi m d { 1 d ( 2 l ) } Y = Y (Theta,Phi) = (-1) . / ---- . ------ . e . sin (Theta) . --- { ------ . --- ( [µ - 1] ) } , with µ = cos(Theta) l V 4Pi (l+m)! m { l l ( ) } dµ { 2 * l! dµ ( ) } Psi = U * Y Prob = 4.pi.r^2.Psi^2 */ //------------ Do not change !!!! -------------------------------------------------------------------------------------- #declare Low = 1; #declare Medium = 2; #declare High = 3; //Declarations needed below. //---------------------------------------------------------------------------------------------------------------------- #version 3.5; // ***************** Variables to change ************************************************************************************* // Quantum numbers of Wave Function #declare n = 6; // n = 1, 2, .. , 10 #declare l = 5; // l = n-1. n-2, .. , 0 #declare m = 0; // m = -l, -l+1, .. , l-1, l // Probability or Wave Function #declare Prob = on; // off; // // Switch between Probability and Wave function. // Visible Density (Probability Function only) #declare Dens = Medium; // Low; // High; // // Switch low and medium density parts of the Probability cloud on/off. // Toggle Cross section on/off #declare Cross = off; // on; // // on = Cross section of electron cloud. Always perpendicular to view. #declare Thick = 5; //10; //2; // // Percentage of Radius for cross section. #declare Shift = 0; // If Cross=0n; -100% .. 0% .. 100%; shifts Cross-section forward or backward. // Be aware that you get three different cross sections if you use Multiple. // Intensity of cloud #declare Intens = 0.5; //1.0; // 1.5; //2; // // Regulates the emission of the cloud. Default=1.0. Mainly meant for Cross. #declare Absorb = 0.25; //0.5; //0.75; //0; // // Absorption of the cloud. Bigger values give deeper look. // 0: mainly surface, 0.25: Higher density is visible (default), // 0.5: Good inner look, 0.75: Gives sometimes inner structure. // Toggle Numbers and Axis on/off #declare Axis = on; // off; // // Toggles axis on/off. #declare Numbers = off; // on; // // Toggle numbers on axis on/off. // Rotate Total Structure (including Axis/Numbers) #declare RotX = 0; // Rotations of cloud and axis. Don't change camera, but only this, #declare RotY = 30; // because labels and cross-section are counter-rotated #declare RotZ = 0; // to hold them in view. #declare RotX2 = 0; // Expand or thrink the cloud // With higher values of n the volume of the cloud depends strongly #declare Exp = 1.0; // on the value of l. ('Exp' actually changes the container radius // by dividing the radius with 'Exp'.) // Toggle Multiple/single view on/off #declare Multiple = on; // off; // // Switch between single (Front) or multiple view (Top, Front, Side). // Toggle quality of media #declare Qual = on; // off; // // With quality on the trace time more than triples, // but it is much more accurate. // Toggle Perspective/Orthographic camera #declare Pers = on; // off; // // Toggle between perspective or orthographic camera. // **************** End of Variables to change ********************************************************************************** //++++++++++++++++++++++++++++++++ Do NOT change the rest of the file +++++++++++++++++++++++++++++++++++++++++++++++++++++ #if ((n>10)|(n<1)|(l>=n)|(l<0)|(m<-l)|(m>l)) // Check if numbers are in range. #error "Quantum numbers out of range !!!!!" #end #if (Cross) #declare Intensity = 1*Intens; // Switch intensity of emission. #if (Shift<-100) #declare Shift = -100; #end // Limit variables #if (Shift>+100) #declare Shift = +100; #end #if (Thick<1) #declare Thick = 1; #end #if (Thick>100) #declare Thick = 100; #end #else #declare Intensity = 0.15*Intens; // Switch intensity of emission. #end #switch (n) // Switch container radius for electron cloud. #case (1) #declare Radius = 7.1/Exp; #break #case (2) #declare Radius = 17/Exp; #break #case (3) #declare Radius = 30/Exp; #break #case (4) #declare Radius = 50/Exp; #break #case (5) #declare Radius = 70/Exp; #break #case (6) #declare Radius = 90/Exp; #break #case (7) #declare Radius = 110/Exp; #break #case (8) #declare Radius = 270/Exp; #break #case (9) #declare Radius = 350/Exp; #break #case (10) #declare Radius = 550/Exp; #break #end #declare Trans = transform{ rotate RotX*x rotate RotY*y rotate RotZ*z rotate RotX2*x } #declare StrN = concat("n = ",str(n,1,0)); #declare StrL = concat("l = ",str(l,1,0)); #declare StrM = concat("m = ",str(m,1,0)); #switch (Dens) #case (Low) #declare StrDens = "Low"; #break #case (Medium) #declare StrDens = "Medium"; #break #case (High) #declare StrDens = "High"; #break #end #declare StrT = str(n,0,0); #if (l=0) #declare StrT = concat(StrT,"s"); #end #if (l=1) #declare StrT = concat(StrT,"p"); #end #if (l=2) #declare StrT = concat(StrT,"d"); #end #if (l=3) #declare StrT = concat(StrT,"f"); #end #if (l=4) #declare StrT = concat(StrT,"g"); #end #if (l=5) #declare StrT = concat(StrT,"h"); #end #if (l=6) #declare StrT = concat(StrT,"i"); #end #if (l=7) #declare StrT = concat(StrT,"j"); #end #if (l=8) #declare StrT = concat(StrT,"k"); #end #if (l=9) #declare StrT = concat(StrT,"l"); #end //---------------------------------------------------------------------------------------------------------------------------------- // p! = p.(p-1).(p-2) .. .3.2.1 #declare Fac = function(Val){select(Val,1,1,prod(i, 1, Val, i))} //---------------------------------------------------------------------------------------------------------------------------------- /* ( p ) p! ( ) = -------- ( q ) q!(p-q)! */ #macro Binom(p,q) ( Fac(p) /Fac(q) /Fac(p-q) ) #end //#macro Binom(p,q) //---------------------------------------------------------------------------------------------------------------------------------- /* 1 l [ p ( l ) l+m-1 { } 2(l-p)-(l+m) ] ------- . Sigma [ (-1) . ( ) . Tau { (2(l-p)-q) } . µ ] , with µ = cos(Theta) and |m| !! l p=0 [ ( p ) q=0 { } ] 2 * l! */ // Derivative = 1 /2^l /Fac(l) * SUM(p=0 -> l) { (-1)^p.Binom(l,p). PRODUCT(q=0 -> lm-1) [2(l-p)-q)] . µ^(2(l-p)-(l+m)) } // = Constant(l) * SUM(p=0 -> l) { Constant(l,lm,p,q) . µ^(2(l-p)-(l+m)) } // = SUM(p=0 -> l) { Constant(l) * Constant(l,lm,p,q) . µ^(2(l-p)-(l+m)) } #declare lm = l+abs(m); // Prepare the Constants: Constant(l) and all Constant(l,lm,p,q). #declare CDer_L = 0; #declare CDer_0 = 0; // They all have to be defined for Derivative. #declare CDer_1 = 0; #declare CDer_2 = 0; #declare CDer_3 = 0; #declare CDer_4 = 0; // #if (l=0) then whole Derivative = 1. #if (l>=1) #declare CDer_L = 1 /pow(2,l) /Fac(l); #declare CDer_0 = CDer_L*(0 // 2*(l-p)-lm #declare p = 0; // l=1; p=0; lm=1 or lm=2 #if ((2*(l-p)-lm)>=0) + pow(-1,p)*Binom(l,p) // 2-1=1 or 2-2=0 #declare q=0; // l=2; p=0; lm=2 or lm=3 or lm=4 #while (q<=(lm-1)) *(2*(l-p)-q) // 4-2=2 or 4-3=1 or 4-4=0 #declare q=q+1; // Create PRODUCT(q=0->lm-1)[2(l-p)-q] #end #end ); #end //#if (l>=1) #if (l>=2) #declare CDer_1 = CDer_L*(0 // 2*(l-p)-lm #declare p = 1; // l=2; p=1; lm=2 or lm=3 or lm=4 #if ((2*(l-p)-lm)>=0) + pow(-1,p)*Binom(l,p) // 2-2=0 or 2-3=-1 .. #declare q=0; // Create PRODUCT(q=0->lm-1)[2(l-p)-q] #while (q<=(lm-1)) *(2*(l-p)-q) // #declare q=q+1; #end #end ); #end //#if (l>=2) #if (l>=4) #declare CDer_2 = CDer_L*(0 // 2*(l-p)-lm #declare p = 2; // l=4; p=2; lm=4 or lm=5 or lm=6 ... #if ((2*(l-p)-lm)>=0) + pow(-1,p)*Binom(l,p) // 4-4=0 or 4-5=-1 #declare q=0; // l=5; p=2; lm=5 or lm=6 or lm=7 ... #while (q<=(lm-1)) *(2*(l-p)-q) // 6-5=1 or 6-6=0 or 6-7=-1 #declare q=q+1; #end #end ); #end //#if (l>=4) #if (l>=6) #declare CDer_3 = CDer_L*(0 // 2*(l-p)-lm #declare p = 3; // l=6; p=3; lm=6 or lm=7 or lm=8 ... #if ((2*(l-p)-lm)>=0) + pow(-1,p)*Binom(l,p) // 6-6=0 or 6-7=-1 #declare q=0; #while (q<=(lm-1)) *(2*(l-p)-q) #declare q=q+1; #end #end ); #end //#if (l>=6) #if (l>=8) #declare CDer_4 = CDer_L*(0 // 2*(l-p)-lm #declare p = 4; // l=8; p=4; lm=8 or lm=9 or lm=10 ... #if ((2*(l-p)-lm)>=0) + pow(-1,p)*Binom(l,p) // 8-8=0 or 8-9=-1 #declare q=0; #while (q<=(lm-1)) *(2*(l-p)-q) #declare q=q+1; #end #end ); #end //#if (l>=8) // Derivative = 1 /2^l /Fac(l) * SUM(p=0 -> l) { (-1)^p.Binom(l,p). PRODUCT(q=0 -> lm-1) [2(l-p)-q)] . µ^(2(l-p)-(l+m)) } // = Constant(l) * SUM(p=0 -> l) { Constant(l,lm,p,q) . µ^(2(l-p)-(l+m)) } // = SUM(p=0 -> l) { Constant(l) * Constant(l,lm,p,q) . µ^(2(l-p)-(l+m)) } #declare Derivative = function { select(l,0,1, // Test l: l=0 -> 1; l>0: select(2*(l-0)-lm>=0,0,1, // p=0; Test 2(l-p)-lm>=0: CDer_0*pow(x/sqrt(x*x+y*y+z*z),2*(l-0)-lm)+ select(2*(l-1)-lm>=0,0,0, // p=1; Test 2(l-p)-lm>=0: CDer_1*pow(x/sqrt(x*x+y*y+z*z),2*(l-1)-lm)+ select(2*(l-2)-lm>=0,0,0, // p=2; Test 2(l-p)-lm>=0: CDer_2*pow(x/sqrt(x*x+y*y+z*z),2*(l-2)-lm)+ select(2*(l-3)-lm>=0,0,0, // p=3; Test 2(l-p)-lm>=0: CDer_3*pow(x/sqrt(x*x+y*y+z*z),2*(l-3)-lm)+ select(2*(l-4)-lm>=0,0,0, // p=4; Test 2(l-p)-lm>=0: CDer_4*pow(x/sqrt(x*x+y*y+z*z),2*(l-4)-lm) ))))))} //---------------------------------------------------------------------------------------------------------------------------------- // Sigma_n_l = SUM(v=0 -> k) {Binom(n+l,k-v)/Fac(v)*(-2r/n)^v} // = 2^0/(0!.n^0).Binom(n+l,k-0).r^0 + // - 2^1/(1!.n^1).Binom(n+l,k-1).r^1 + // + 2^2/(2!.n^2).Binom(n+l,k-2).r^2 + // - 2^3/(3!.n^3).Binom(n+l,k-3).r^3 + ..... #declare k = n-l-1; #declare CS_0 = 0; #if (k>=0) #declare CS_0 = Binom(n+l,k- 0)/Fac( 0)/pow(n, 0); #end #declare CS_1 = 0; #if (k>=1) #declare CS_1 = Binom(n+l,k- 1)/Fac( 1)/pow(n, 1); #end #declare CS_2 = 0; #if (k>=2) #declare CS_2 = Binom(n+l,k- 2)/Fac( 2)/pow(n, 2); #end #declare CS_3 = 0; #if (k>=3) #declare CS_3 = Binom(n+l,k- 3)/Fac( 3)/pow(n, 3); #end #declare CS_4 = 0; #if (k>=4) #declare CS_4 = Binom(n+l,k- 4)/Fac( 4)/pow(n, 4); #end #declare CS_5 = 0; #if (k>=5) #declare CS_5 = Binom(n+l,k- 5)/Fac( 5)/pow(n, 5); #end #declare CS_6 = 0; #if (k>=6) #declare CS_6 = Binom(n+l,k- 6)/Fac( 6)/pow(n, 6); #end #declare CS_7 = 0; #if (k>=7) #declare CS_7 = Binom(n+l,k- 7)/Fac( 7)/pow(n, 7); #end #declare CS_8 = 0; #if (k>=8) #declare CS_8 = Binom(n+l,k- 8)/Fac( 8)/pow(n, 8); #end #declare CS_9 = 0; #if (k>=9) #declare CS_9 = Binom(n+l,k- 9)/Fac( 9)/pow(n, 9); #end #declare CS_10 = 0; #if (k=10) #declare CS_10 = Binom(n+l,k-10)/Fac(10)/pow(n,10); #end #declare Sigma_n_l = function { CS_0 // k=0 - select(k,0,0, // k>=1 CS_1*sqrt(x*x+y*y+z*z) // k=1 + select(k-1,0,0, // k>=2 CS_2*(x*x+y*y+z*z) // k=2 - select(k-2,0,0, // k>=3 CS_3*pow(sqrt(x*x+y*y+z*z),3) // k=3 + select(k-3,0,0, // k>=4 CS_4*pow(x*x+y*y+z*z,2) // k=4 - select(k-4,0,0, // k>=5 CS_5*pow(sqrt(x*x+y*y+z*z),5) // k=5 + select(k-5,0,0, // k>=6 CS_6*pow(x*x+y*y+z*z,3) // k=6 - select(k-6,0,0, // k>=7 CS_5*pow(sqrt(x*x+y*y+z*z),7) // k=7 + select(k-7,0,0, // k>=8 CS_6*pow(x*x+y*y+z*z,4) // k=8 - select(k-8,0,0, // k>=9 CS_5*pow(sqrt(x*x+y*y+z*z),9) // k=9 + select(k-9,0,0, // k>=10 CS_6*pow(x*x+y*y+z*z,5))))))))))) // k=10 } //---------------------------------------------------------------------------------------------------------------------------------- #declare CosInverse = function(y,z){ select(y, // Test = y 2*pi-acos(z/sqrt(y*y+z*z)), // y <0: Third and fourth quadrant: 360 - acos. acos(z/sqrt(y*y+z*z)) // y >=0: First and second quadrant: acos gives correct answer. ) } #declare SinInverse = function(y,z){ select(z, // Test = z pi-asin(y/sqrt(y*y+z*z)), // z <0: Second and third quadrant: 180 - asin. select(y, // z >=0: Test = y: 2*pi+asin(y/sqrt(y*y+z*z)), // y <0: Fourth quadrant: 360 + asin. asin(y/sqrt(y*y+z*z)) // y >=0: First quadrant: asin gives correct answer. ) ) } // 'select' prefends for division by zero errors: select(A,B,C,D), B if A<0, C if A=0, D if A>0. #declare Exp_imPhi = function{select(abs(m),1,1,cos(abs(m)*CosInverse(y,z)) + m/abs(m)*sin(abs(m)*SinInverse(y,z)))} //---------------------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------------------- #declare C_U = pow(2,(l+1)) / pow(n,(l+2))/sqrt( Fac(2*l+1)*Binom(n+l,n-l-1) ); #declare C_Y = pow(-1,abs(m)) * sqrt( (2*l+1)/4/pi * Fac(l-abs(m))/Fac(l+abs(m)) ); // 'select' prefends division by zero errors: select(A,B,C,D), B if A<0, C if A=0, D if A>0. #declare Psi = function { select(x*x+y*y+z*z,0,0, C_U * pow(sqrt(x*x+y*y+z*z),l) * exp(-sqrt(x*x+y*y+z*z)/n) * Sigma_n_l(x,y,z) * C_Y * Exp_imPhi(x,y,z) * pow(sqrt(y*y+z*z)/sqrt(x*x+y*y+z*z),abs(m)) * Derivative(x,y,z) ) } #if (Prob) #declare Func = function {4*pi*(x*x+y*y+z*z)*pow(Psi(x,y,z),2)} #else #declare Func = function {Psi(x,y,z)+0.5} #end // // -------------------------------------------------------------------------------------------------------------------- #macro ColorMap () #if (Prob) [0.00 rgb <0.0, 0.0, 0.0>] #if (Dens=Low) // Color_map for Low density [0.001 rgb <0.4, 0.0, 0.0>] [0.003 rgb <0.5, 0.1, 0.0>] [0.005 rgb <0.6, 0.2, 0.0>] [0.01 rgb <0.7, 0.3, 0.0>] [0.015 rgb <0.7, 0.7, 0.0>] [0.02 rgb <0.0, 0.7, 0.0>] [0.03 rgb <0.0, 0.0, 0.7>] [0.05 rgb <0.0, 0.4, 0.7>] [0.07 rgb <0.0, 0.7, 0.7>] [0.50 rgb <0.7, 0.7, 0.7>] [0.75 rgb <0.7, 0.7, 0.7>] [1.00 rgb <1.0, 0.7, 0.7>] #else #if (Dens = Medium) // Color_map for Medium density. [0.01 rgb <0.0, 0.0, 0.0>] [0.015 rgb <0.7, 0.7, 0.0>] [0.02 rgb <0.0, 0.7, 0.0>] [0.03 rgb <0.0, 0.0, 0.7>] [0.05 rgb <0.0, 0.4, 0.7>] [0.07 rgb <0.0, 0.7, 0.7>] [0.50 rgb <0.7, 0.7, 0.7>] [0.75 rgb <0.7, 0.7, 0.7>] [1.00 rgb <1.0, 0.7, 0.7>] #else //#if (Dens = Medium) // Color_map for High density. [0.05 rgb <0.0, 0.0, 0.0>] [0.07 rgb <0.0, 0.7, 0.7>] [0.50 rgb <0.7, 0.7, 0.7>] [0.75 rgb <0.7, 0.7, 0.7>] [1.00 rgb <1.0, 0.7, 0.7>] #end #end //#if (Dens=Low) #else //#if (Prob) // Color_map for Wavefunction. [0.00 rgb <0.0, 0.0, 0.0>] [0.25 rgb <1.0, 0.0, 0.0>] [0.43 rgb <0.7, 0.7, 0.0>] [0.45 rgb <0.0, 1.0, 0.0>] [0.47 rgb <0.0, 0.7, 0.7>] [0.48 rgb <0.0, 0.0, 1.0>] [0.485 rgb <0.7, 0.0, 0.7>] [0.49 rgb <0.3, 0.7, 0.3>] [0.495 rgb <0.2, 0.1, 0.1>] [0.49999 rgb <0.2, 0.0, 0.0>] [0.50 rgb <0.2, 0.0, 0.0>] [0.50 rgb <0.0, 0.0, 0.1>] [0.50001 rgb <0.0, 0.0, 0.1>] [0.505 rgb <0.0, 0.2, 0.1>] [0.51 rgb <0.7, 0.7, 0.0>] [0.515 rgb <0.0, 1.0, 0.0>] [0.52 rgb <0.0, 0.7, 0.7>] [0.53 rgb <0.0, 0.0, 1.0>] [0.55 rgb <0.7, 0.0, 0.7>] [0.57 rgb <0.3, 0.7, 0.3>] [0.75 rgb <1.0, 0.0, 0.0>] [1.00 rgb <0.3, 0.3, 0.4>] #end //#if (Prob) #end //#macro ColorMap () #macro CreateAxis(Trans,RotView) #if (Axis) #local TransView = transform { rotate RotView } // In order to inverse RotView. cylinder {-Radius*x, Radius*x, 0.004*Radius/5} // x-axis cylinder {-Radius*y, Radius*y, 0.004*Radius/5} // y-axis cylinder {-Radius*z, Radius*z, 0.004*Radius/5} // z-axis text { ttf "crystal.ttf" "x" 0.1, 0 // Create labels scale Radius/10 transform {TransView inverse } transform {Trans inverse } // Counter rotation to keep good visibility. translate < Radius+0.5*Radius/10, -Radius/10, 0> // Translate to position no_shadow } text { ttf "crystal.ttf" "-x" 0.1, 0 scale Radius/10 transform {TransView inverse } transform {Trans inverse } translate < -Radius-Radius/10, -Radius/10, 0> no_shadow } text { ttf "crystal.ttf" "y" 0.1, 0 scale Radius/10 transform {TransView inverse } transform {Trans inverse } translate < -Radius/10, Radius, 0> no_shadow } text { ttf "crystal.ttf" "-y" 0.1, 0 scale Radius/10 transform {TransView inverse } transform {Trans inverse } translate < -1.5*Radius/10, -Radius-0.5*Radius/10, 0> no_shadow } text { ttf "crystal.ttf" "z" 0.1, 0 scale Radius/10 transform {TransView inverse } transform {Trans inverse } translate < -Radius/10, 0, Radius+Radius/10 > no_shadow } text { ttf "crystal.ttf" "-z" 0.1, 0 scale Radius/10 transform {TransView inverse } transform {Trans inverse } translate < -1.5*Radius/10, 0, -Radius-Radius/10 > no_shadow } #declare Count = -floor(Radius); // Initiation #while (Count <= Radius) // Create calibration stripes of axis #if (Count!=0) #if ( ( (Radius< 30) & (mod(Count, 5)=0) ) | ( (Radius< 110) & (mod(Count,10)=0) ) | ( (Radius>=110) & (mod(Count,50)=0) ) ) cylinder {0, 0.2*Radius/5*y, 0.004*Radius/5 transform {TransView inverse } transform {Trans inverse } translate Count*x} cylinder {0, 0.2*Radius/5*x, 0.004*Radius/5 transform {TransView inverse } transform {Trans inverse } translate Count*y} cylinder {0, 0.2*Radius/5*y, 0.004*Radius/5 transform {TransView inverse } transform {Trans inverse } translate Count*z} #if (Numbers) text { ttf "crystal.ttf" str(Count,2,0) 0.1, 0 scale Radius/17.5 transform {TransView inverse } transform {Trans inverse } translate < 0.2*Radius/4, Count, 0> no_shadow } text { ttf "crystal.ttf" str(Count,2,0) 0.1, 0 scale Radius/17.5 transform {TransView inverse } transform {Trans inverse } translate < Count, 0.2*Radius/4, 0> no_shadow } text { ttf "crystal.ttf" str(Count,2,0) 0.1, 0 scale Radius/17.5 transform {TransView inverse } transform {Trans inverse } translate < 0, 0.2*Radius/4, Count> no_shadow } #end //#if (Numbers) #else //if ((Count!=0) & ( ((Radius<10)&(mod(Count,5)=0)) | ((Radius>=10)&(mod(Count,10)=0)) ) ) #if ((Radius<10)&(Count!=0)) cylinder {0,0.1*Radius/5*y,0.004*Radius/5 transform {TransView inverse } transform {Trans inverse } translate Count*x} cylinder {0,0.1*Radius/5*x,0.004*Radius/5 transform {TransView inverse } transform {Trans inverse } translate Count*y} cylinder {0,0.1*Radius/5*y,0.004*Radius/5 transform {TransView inverse } transform {Trans inverse } translate Count*z} #end //#if (Radius<10) #end ////if ((Count!=0) & ( ((Radius<10)&(mod(Count,5)=0)) | ((Radius>=10)&(mod(Count,10)=0)) ) ) #end //#if (Count!=0) #declare Count = Count+1; // Next #end //while (Count <= Radius+1) #end //#if (Axis) #end //#macro CreateAxis() // Create object with density #macro ElectronCloud (Trans,RotView) // Total wave function. // The container #local TransView = transform { rotate RotView } #if (Cross) intersection { // Slize of x*Radius. sphere { 0, Radius} plane {-z, Thick/200*Radius-Shift/100*Radius // Shift Cross-section transform {TransView inverse } transform {Trans inverse } } // Counter rotates with rotations, so plane { z, Thick/200*Radius+Shift/100*Radius transform {TransView inverse } transform {Trans inverse } } // you always look perpendicular at it. #else sphere { 0, Radius // Intersection or sphere is closed at end of macro!!! #end //#if (Cross) pigment { color rgbt <1,1,1,1> } // Transparant container needed interior { media { absorption rgb<1,1,1>*Absorb // Regulates absorption. emission <1,1,1>*Intensity // Regulates emission. #if (Qual) method 3 samples 3,10 intervals 10 #else intervals 1 #end // // Let POV decide how many. density { function{Func(x,y,z)} // Switch functions with n,l and m. color_map { ColorMap () } // color_map depends on Prob or Wave func } //density } //media } //interior hollow on } //object or intersection #end //#macro ElectronCloud #declare TotalObjFront = union { object { ElectronCloud (Trans,<0,0,0>) } // The wave functions CreateAxis(Trans,<0,0,0>) // Front View pigment { color rgb <1,1,1> } finish { ambient 0.9 } transform Trans } //union #if (Multiple = on) #declare TotalObjSide = union { object { ElectronCloud (Trans,<0,90,0>) } // The wave functions CreateAxis(Trans,<0,90,0>) // Side View pigment { color rgb <1,1,1> } finish { ambient 0.9 } transform Trans } //union #declare TotalObjTop = union { object { ElectronCloud (Trans,<-90,0,0>) } // The wave functions CreateAxis(Trans,<-90,0,0>) // Top View pigment { color rgb <1,1,1> } finish { ambient 0.9 } transform Trans } //union object { TotalObjFront scale 0.5 translate < -0.450*Radius, -0.40*Radius, 0> } object { TotalObjSide scale 0.5 rotate <0,90,0> translate < 0.800*Radius, -0.40*Radius, 0> } object { TotalObjTop scale 0.5 rotate <-90,0,0> translate < 0.175*Radius, +0.45*Radius, 0> } text { ttf "crystal.ttf" "Top" 0.1, 0 scale Radius/10 translate < -0.5*Radius, 0.9*Radius, 0> pigment { color rgb <1,1,1> } finish { ambient 0.9 } no_shadow } text { ttf "crystal.ttf" "Front" 0.1, 0 scale Radius/10 translate < -0.95*Radius, 0.1*Radius, 0> pigment { color rgb <1,1,1> } finish { ambient 0.9 } no_shadow } text { ttf "crystal.ttf" "Side" 0.1, 0 scale Radius/10 translate < 1.1*Radius, 0.1*Radius, 0> pigment { color rgb <1,1,1> } finish { ambient 0.9 } no_shadow } #else object { TotalObjFront } #end // Info: Type, n, l, m union { text { ttf "crystal.ttf" StrT 0.1, 0 scale Radius/7 translate < -1.3*Radius, 0.9*Radius, 0> no_shadow } text { ttf "crystal.ttf" str(m,1,0) 0.1, 0 scale Radius/10 translate < -1.3*Radius+Radius/7*(n>=10?1.5:1), 0.9*Radius-0.5*Radius/10, 0> no_shadow } text { ttf "crystal.ttf" StrN 0.1, 0 scale Radius/10 translate < Radius, 0.95*Radius, 0> no_shadow } text { ttf "crystal.ttf" StrL 0.1, 0 scale Radius/10 translate < Radius, 0.95*Radius-Radius/10, 0> no_shadow } text { ttf "crystal.ttf" StrM 0.1, 0 scale Radius/10 translate < Radius, 0.95*Radius-2*Radius/10, 0> no_shadow } pigment { color rgb <1,1,1> } finish { ambient 0.9 } } //union // Calibration of cloud density for Calibration cylinder #if (Prob) #declare Cyl = function{(y/Radius*1.25)*(y/Radius*1.25)} // Quadratic distribution matches cloud distribution better. #else #declare Cyl = function{((y-Radius/2.5)/Radius*1.25)*abs((y-Radius/2.5)/Radius*1.25)*2+0.5} // Zero in middle of cylinder. #end // Calibration cylinder union { cylinder { <0, 0, 0>, <0, Radius/1.25, 0>, Radius/15 pigment { color rgbt <1,1,1,1> } interior { media { absorption rgb<1,1,1>*Absorb // Regulates absorption emission <1,1,1>*(Intensity<0.5?Intensity*2:Intensity*0.7)*(25/Radius+sqrt(Radius)/50) // Regulates emission intervals 1 // Let POV decide how many. density { function{Cyl(x,y,z)} color_map { ColorMap () } //color_map } //density } //media } //interior translate <-1.33*Radius, -Radius/2.5, 0> hollow on } //cylinder union { // Calibration labels and cylinder { <-1.33*Radius, Radius/2.5, 0>, <-1.33*Radius, Radius/2.5+Radius/100, 0>, Radius/15 } // type texts. cylinder { <-1.33*Radius, -Radius/2.5, 0>, <-1.33*Radius, -Radius/2.5-Radius/100, 0>, Radius/15 } #if (Prob) text { ttf "crystal.ttf" "1.00" 0.1, 0 scale Radius/10 translate <-1.33*Radius+Radius/15, Radius/2.5, 0> no_shadow } text { ttf "crystal.ttf" "0.75" 0.1, 0 scale Radius/10 translate <-1.33*Radius+Radius/15, (0.5*sqrt(3)-0.5)*Radius/2.5, 0> no_shadow } text { ttf "crystal.ttf" "0.10" 0.1, 0 scale Radius/10 translate <-1.33*Radius+Radius/15, (0.1*sqrt(10)-0.5)*Radius/2.5, 0> no_shadow } text { ttf "crystal.ttf" "0.00" 0.1, 0 scale Radius/10 translate <-1.33*Radius+Radius/15, -Radius/2.5-0.75*Radius/10, 0> no_shadow } text { ttf "crystal.ttf" StrDens 0.1, 0 scale Radius/15 translate <-1.33*Radius-Radius/15, Radius*0.4+Radius/10, 0> no_shadow } text { ttf "crystal.ttf" "Probability" 0.1, 0 scale Radius/15 translate <-1.33*Radius-Radius/15, -Radius*0.7, 0> no_shadow } text { ttf "crystal.ttf" "Distribution" 0.1, 0 scale Radius/15 translate <-1.33*Radius-Radius/15, -Radius*0.7-Radius/10, 0> no_shadow } #else //#if (Prob) text { ttf "crystal.ttf" "+0.50" 0.1, 0 scale Radius/10 translate <-1.33*Radius+Radius/15, Radius/2.5, 0> no_shadow } text { ttf "crystal.ttf" "+0.25" 0.1, 0 scale Radius/10 translate <-1.33*Radius+Radius/15, 0.1*sqrt(50)*Radius/2.5, 0> no_shadow } text { ttf "crystal.ttf" "+0.10" 0.1, 0 scale Radius/10 translate <-1.33*Radius+Radius/15, 0.1*sqrt(20)*Radius/2.5, 0> no_shadow } text { ttf "crystal.ttf" "-0.10" 0.1, 0 scale Radius/10 translate <-1.33*Radius+Radius/15, -0.1*sqrt(20)*Radius/2.5, 0> no_shadow } text { ttf "crystal.ttf" "-0.25" 0.1, 0 scale Radius/10 translate <-1.33*Radius+Radius/15, -0.1*sqrt(50)*Radius/2.5, 0> no_shadow } text { ttf "crystal.ttf" "-0.50" 0.1, 0 scale Radius/10 translate <-1.33*Radius+Radius/15, -Radius/2.5-0.75*Radius/10, 0> no_shadow } text { ttf "crystal.ttf" "Wave" 0.1, 0 scale Radius/15 translate <-1.33*Radius-Radius/15, -Radius*0.7, 0> no_shadow } text { ttf "crystal.ttf" "Function" 0.1, 0 scale Radius/15 translate <-1.33*Radius-Radius/15, -Radius*0.7-Radius/10, 0> no_shadow } #end //#if (Prob) #if (Cross) // text { ttf "crystal.ttf" "Cross-section" 0.1, 0 scale Radius/15 text { ttf "crystal.ttf" concat("Shift = ",str(Shift,1,0)," %") 0.1, 0 scale Radius/15 translate <-1.33*Radius-Radius/15, -Radius*0.7-2*Radius/10, 0> no_shadow } text { ttf "crystal.ttf" concat("Cross-section = ",str(Thick,1,0)," %") 0.1, 0 scale Radius/15 translate <-1.33*Radius-Radius/15, -Radius*0.7-3*Radius/10, 0> no_shadow } #end //#if (Cross) pigment { color rgb <0.8,0.8,1> } finish { ambient 0.9 } } //union } //union camera { #if (Pers) perspective #else orthographic #end // Toggle camera. right x*image_width/image_height location <0.0, 0.0, -3.5*Radius> // Location depends on Radius. look_at <0.0, 0.0, 0.0> angle 45 }