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-2024 Shodor