# Complimentary .NET Software on Special functions

The spherical harmonics are not easy to imagine, but a rotation animation can help visualize de surface shapes. This demo will plot and animate the Spherical Harmonics as shown below. It works up to l + m =20. The operation is straight forward.

The author of this piece of software is Armando Rodriguez, (resume and biography)

It includes a SphericalHarmonics.dll and a SphericalHarmonicsTest.exe. The DLL can be called from any language that complies to the .NET CLS (Common Language Specifications) and offers the following namespace:

Namespace SpecialFunctions

Namespace SpecialFunctions
{
sealed public class Combinatorials
{
public static long Productorial(int nMin, int nMax)
public static double ProductorialDbl(int nMin, int nMax)
public static double ProductorialDivision(int mMin, int mMax,
int nMin, int nMax)
public static long Variation(int n, int m)
public static double VariationDbl(int n, int m)
public static long Factorial(int n)
public static double FactorialDbl(int n)
public static long Combination(int n, int m)
public static double CombinationDbl(int n, int m)
}
public class Complex
{
public double R
public double I
public Complex()
public Complex(double r, double i)
public Complex(Complex worldZ)
public double Modulus2()
public double Modulus()
public static Complex Exp(Complex c)
public static Complex operator +(Complex c1, Complex c2)
public static Complex Add(Complex c1, Complex c2)
public static Complex operator *(Complex c1, Complex c2)
public static Complex Multiply(Complex c1, Complex c2)
public static bool operator ==(Complex c1, Complex c2)
public static bool IsEqual(Complex c1, Complex c2)
public override bool Equals(Object o)
public override int GetHashCode()
public static bool operator !=(Complex c1, Complex c2)
public static bool IsNotEqual(Complex c1, Complex c2)
public override string ToString()
}
public class Legendre
{
public Legendre()
public double Polynomials(int n, double u)
public double AssocPolynomials(int n, int m, double u)
}
public class SphericalHarmonics : Legendre
{
public SphericalHarmonics()
public Complex Y(int n,int m, double theta, double phi)
}
public class Vector
{
public Vector(double xx, double yy, double zz)
public Vector(double theta, double phi, double r, bool spherical)
public Vector(Vector r)
public Vector()
public double X
public double Y
public double Z
public double R2()
public double Mod()
public Vector Rx(Vector r)
public double Rdot(Vector r)
public Vector Unit()
public void GoUnit()
public static Vector operator +(Vector a, Vector b)
public static Vector operator -(Vector a, Vector b)
public static Vector Add(Vector a, Vector b)
public static Vector Subtract(Vector a, Vector b)
public void Scale(double factor)
public bool Equals(Vector r)
public static Vector GetNormal(Vector a, Vector b, Vector c)
}
public class Direction: Vector
{
public Direction()
public Direction(double azimuth, double polar)
public Direction(Vector v)
public Direction(double worldX, double worldY, double worldZ)
public virtual void Update(double azimuth, double polar)
public virtual void Update(double worldX, double worldY, double
}
public class Projection : Direction

{
public double OriginX
public double OriginY
public double ScaleX
public double ScaleY
Projection()
public Projection(double azimuth, double polar)
public Projection(double worldX, double worldY, double worldZ)
public override void Update(double azimuth, double polar)
public override void Update(double worldX,
double worldY,
double worldZ)
public double ProjectionX(Vector r)
public double ProjectionY(Vector r)
public double ProjectionX(  double worldX,
double worldY,
double worldZ)
public double ProjectionY(  double worldX,
double worldY,
double worldZ)
public Complex XY(Vector r)
public Complex XY(double r, double theta, double phi)
public bool TileProyection( double maxLuminance, ref double luminance,
Vector[] tile, ref Complex[] xy)
public bool GetFirstWorldPoint(SpaceForm[] spaceForms, ref Vector[] element

, ref int spIndx)
public bool GetNextWorldPoint(SpaceForm[] spaceForms, ref Vector[] element

, ref int spIndx)
public bool GetFirstWorldPoint(SpaceForm[] spaceForms, ref Vector[] element

, ref byte param
, ref int spIndx)
public bool GetNextWorldPoint(SpaceForm[] spaceForms, ref Vector[] element

, ref byte param
, ref int spIndx)
}
public class SpaceForm
{
public SpaceForm()
public SpaceForm(int d1, int d2, int sftype)
public SpaceForm(int d1, int d2, bool withParams, int sftype)
public SpaceForm(string filePath, bool Spherical, int sftype)
public void Init(int d1, int d2, bool withParams, int sftype)
private string lastException;
public string LastException
private int[] proximitySort;
private int sfType;
public int SfType
public static int Points
public static int Curve
public static int Surface
private Vector[,] vArray;
public Vector[,] VectorArray
private byte[,] paramArray;
public byte[,] ParamArray
private int dim1=0, dim2=0;
public int Dim1
public int Dim2
private bool closed = true;
public bool Closed
public bool SetPoint(int m, int n, Vector r)
public bool SetPoint(int m, int n, Vector r, byte param)
public bool SetPoint(int m, int n, double x, double y, double z)
public bool SetPoint(int m, int n, double x, double y, double z, byte param)
public Vector GetPoint(int m, int n)
private double[] proximity;
public int DoProximitySort(Direction sight)
private int arrPtr = 0;
public bool GetElement(int m,int n, ref Vector[] element)
public double CurrentProximity(bool initialize)
public bool GetFirstElement( ref Vector[] element)
public bool GetNextElement( ref Vector[] element)
public bool GetFirstElement( ref Vector[] element, ref byte param)
public bool GetNextElement( ref Vector[] element, ref byte param)
}

public class PointArray: SpaceForm
{
public PointArray(int d1): base(d1,1,SpaceForm.Points)
public PointArray(int d1, bool withParams):base(d1,1,withParams,SpaceForm.Points)
public PointArray(string filePath, bool spherical):base(filePath,spherical

,SpaceForm.Points)
}
public class Curve: SpaceForm
{
public Curve(int d1): base(d1,1,SpaceForm.Curve)
public Curve(int d1, bool withParams):base(d1,1,withParams,SpaceForm.Curve)
public Curve(string filePath, bool spherical):base(filePath,spherical

,SpaceForm.Curve)
public Vector GetTangent(int m)
}
public class Surface : SpaceForm
{
public Surface(int d1, int d2): base(d1,d2,SpaceForm.Surface)
public Surface(int d1, int d2, bool withParams):base(d1,d2,withParams

,SpaceForm.Surface)
public Surface(string filePath, bool spherical):base(filePath,spherical

,SpaceForm.Surface)
public Vector GetNormal(int m, int n)
public void AddPlane(ref SpaceForm[] spArray, Direction pNormal

, double parameter)
}
}