#include "colors.inc" #include "math.inc" global_settings { assumed_gamma 1.0 ambient_light rgb <1,1,1> } #declare ltime =clock+.80; #declare camera_scale=5; camera { // location <8, 15 , 15> location camera_scale*<0, 12 , -20> look_at <0, 0, 0> angle 60/camera_scale } #declare radius_etors=1; //small radius of charge flight path loop #declare radius_etorl=9; //large radius of charge flight path loop #declare loops_etor=6; // number of loops per main orbit #declare num_sect=300; //number of sections used to draw toroidal helix #declare ptime=0; #declare p1=vrotate((vrotate(radius_etors*x,ptime*360*loops_etor*z)+radius_etorl*x),ptime*360*y); #while(ptime<=1) #declare ptime=ptime+1/num_sect; #declare p2=vrotate((vrotate(radius_etors*x,ptime*360*loops_etor*z)+radius_etorl*x),ptime*360*y); cylinder { p1, p2,.03 texture {pigment { color rgb <.1,1,1> } finish{ambient .7 diffuse 0}}} #declare p1=p2; #end torus {radius_etorl, radius_etors*1.8 pigment{color rgbf <1,1,1,1>} texture {pigment {color rgbf 1}} hollow interior { media { emission color rgbf < 0.15, 0.0, 0,1> scattering {5} intervals 2 samples 32 method 3 aa_threshold 0.3 aa_level 5 density {cylindrical scale 1.2*(radius_etorl+radius_etors)} } } } //field loop union{ torus {radius_etorl, radius_etors*.05} #declare pointersize=radius_etors*.3; cone{x*0,pointersize,z*pointersize*1.5,0 translate x*radius_etorl rotate y*90} texture {pigment { color rgbt <0,1,0,0> } finish{ambient .7 diffuse 0}} } //electron flight parameters #declare dt = .001; #declare pnow=vrotate((vrotate(radius_etors*x,ltime*360*loops_etor*z)+radius_etorl*x),ltime*360*y); #declare pp=vrotate((vrotate(radius_etors*x,(ltime+dt)*360*loops_etor*z)+radius_etorl*x),(ltime+dt)*360*y); #declare pm=vrotate((vrotate(radius_etors*x,(ltime-dt)*360*loops_etor*z)+radius_etorl*x),(ltime-dt)*360*y); #declare erad=.3; #declare vel=1.5*vnormalize((pp-pm)/dt); #declare acc=1.2*vnormalize((pp+pm-2*pnow)/(dt*dt)); #declare vxlen=-.6; #declare vylen =-vxlen; union{ sphere { <0, 0, 0>, erad texture {pigment { color rgbt <.2,.2,.9,.0> } finish{ambient 2.0 diffuse 0}} } union{ cylinder{0,vel,.03} cone { vel, 0.1 1.2*vel, 0} union{ text {ttf "Times" "v" .005, 0 scale 1 } scale 1.5 translate 1.4*vel} texture {pigment { color rgbt <1,.1,1,.0> } finish{ambient 1.0 diffuse 0}} } union{ cylinder{0,acc,.03} cone {acc, 0.1 1.4*acc, 0} union{ text {ttf "Times" "a" .005, 0 scale 1} scale 1.5 translate 1.2*acc } texture {pigment { color rgbt <1,1,0,.0> } finish{ambient 1.0 diffuse 0}} } translate pnow } //field lines #declare dx = 4; //spacing of field lines #declare dz = 4; //vertical extent of field lines #declare xlimit =4.; //horizontal range of field lines #declare zlimit =4.; //"depth" range of field lines #declare xnow = -xlimit; #declare rottxt = 0; #declare btop = 10; #declare bbot = 0; #declare halffield = union{ #while(xnow <= xlimit) #declare znow = -zlimit; #while(znow <= zlimit) union{ cylinder{,,.03} cone { , 0.1 , 0.00001} texture {pigment { color rgbt <.1,.4,.1,.8> } finish{ambient 1.0 diffuse 0}} } #declare znow = znow + dz; #end #declare xnow = xnow + dx; #end } /*union{ object{halffield} object{halffield translate -btop*y} rotate y*10 } */