POV-Ray : Newsgroups : povray.advanced-users : quantum physics : Re: quantum physics Server Time
29 Jul 2024 14:15:09 EDT (-0400)
  Re: quantum physics  
From: Mike Williams
Date: 13 Dec 2001 15:46:00
Message: <xal7ZAAFNRG8EwOc@econym.demon.co.uk>
Wasn't it JRG who wrote:
>Some properly rotated lemniscates should *fake* p orbitals quite well. BTW
>you can always try with some parametric equations (not that easy):
>2px is given by the following parametric function (I'm using polar
>coordinates):
>1/4*pow(1/(2*pi),1/2)*pow(Z/a,3/2)*(Z*r/a)*exp(-Z*r/(2*a))*sin(theta)*sen(ph
>i)
>where Z is the atomic number and a = 0.529 e-10 m.
>2py:
>1/4*pow(1/(2*pi),1/2)*pow(Z/a,3/2)*(Z*r/a)*exp(-Z*r/(2*a))*cos(theta)
>2pz:
>1/4*pow(1/(2*pi),1/2)*pow(Z/a,3/2)*(Z*r/a)*exp(-Z*r/(2*a))*sin(theta)*cos(ph
>i)
>
>The parametric equations are (obviously):
>x = r*sin(theta)*sin(phi);
>y = r*sin(theta)*cos(phi);
>z = r*cos(theta);
>
>Nothing that I would really try. Good luck.

Oops. Please Ignore my previous post. For some reason I'd thought that
"r" was some constant, but it's the third polar co-ordinate.

So converting 
 1/4*pow(1/(2*pi),1/2)*pow(Z/a,3/2)*(Z*r/a)*exp(-Z*r/(2*a))*sin(theta)
 *sen(phi)
into POV code gives us 

#declare  F = function {1/4 
                        * (1/(2*pi))^(1/2)
                        * (Z/a)^(3/2) 
                        * (Z*f_r(x,y,z)/a) 
                        * exp(-Z*f_r(x,y,z)/(2*a))
                        * sin(f_th(x,y,z))
                        * sin(f_ph(x,y,z))
                        }

This has a lobe in the positive x direction when the threshold is
positive, and a lobe in the negative x direction when the threshold is
negative. To render both lobes at once, I've taken the square of the
function, so that both lobes are rendered with positive threshold.

The 2py function has four lobes, and the 2pz has one lobe.


#include "functions.inc"

sky_sphere { pigment {
    function{abs(y)}
    color_map { [0.0 color blue 0.6] [1.0 color rgb 1] } 
  }
}

light_source {<100,400,-100> colour rgb 1}

#declare R = 1.5;
camera { location  <0, 0, -2*R> look_at <0, 0, 0>}

#declare Z=3;
#declare a=0.529;

//1/4*pow(1/(2*pi),1/2)*pow(Z/a,3/2)*(Z*r/a)*exp(-Z*r/(2*a))
//*sin(theta)*sen(phi)


#declare  F = function {1/4 
                        * (1/(2*pi))^(1/2)
                        * (Z/a)^(3/2) 
                        * (Z*f_r(x,y,z)/a) 
                        * exp(-Z*f_r(x,y,z)/(2*a))
                        * sin(f_th(x,y,z))
                        * sin(f_ph(x,y,z))
                        }


isosurface {
  function { F(x,y,z)^2 }
        //max_gradient 3500
        threshold 0.1
        contained_by{sphere{0,R}} open
        pigment {rgb .9}
        finish {phong 0.5 phong_size 10}
}

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.