( ! ) Notice: session_start() [function.session-start]: Server 127.0.0.1 (tcp 21201) failed with: Failed reading line from stream (0) in /var/www/html/refdesk/app/control/session.php5 on line 21
Call Stack
#TimeMemoryFunctionLocation
10.0007166016{main}( )../viewer.php5:0
20.0011216032include_once( '/var/www/html/refdesk/config/standardIncludes.php5' )../viewer.php5:2
30.03744112584include_once( '/var/www/html/refdesk/app/control/session.php5' )../standardIncludes.php5:98
40.03864271968session_start ( )../session.php5:21
CSERD: Spherical Harmonic class

CSERD


  • userhome
  • catalog
  • resources
  • help

Spherical Harmonic class


Shodor > CSERD > Resources > Libraries > Spherical Harmonic class

  Download Source Code  •  Documentation  •  View License Agreement


SphericalHarmonic class documentation

SphericalHarmonic returns the value of Plm(theta,phi) where theta and phi are defined in terms of a standard spherical coordinate system (phi measures angle (x,y,z) makes with z axis.) The algorithm is taken from Messiah's Quantum Mechanics, but readers should note that Messiah defines theta and phi in opposite order from this implementation.

The java version of this code uses the factorial routines in MathLib. Functions are provided for the C++ class. This class should be used in conjunction with AssocLegendre.

Languages:

  • C++
  • Java

    C++

    Member variables

    
      private :
        int l;
        int m;
    

    Methods

  • Constructor: SphericalHarmonic::SphericalHarmonic();
  • Constructor: SphericalHarmonic::SphericalHarmonic(int l,int m);
  • Destructor: SphericalHarmonic::~SphericalHarmonic();
  • void SphericalHarmonic::setL(int l);
  • void SphericalHarmonic::setM(int m);
  • void SphericalHarmonic::setLM(int l,int m);
  • int SphericalHarmonic::getL();
  • int SphericalHarmonic::getM();
  • Complex SphericalHarmonic::eval(double theta, double phi);

    Java

    Member variables

    
        private int l;
        private int m;
    

    Methods

  • Constructor: public SphericalHarmonic()
  • Constructor: public SphericalHarmonic(int l,int m)
  • public void setL(int l)
  • public void setM(int m)
  • public void setLM(int l,int m)
  • public int getL()
  • public int getM()
  • public Complex eval(double theta, double phi)

  • ©1994-2025 Shodor