1 |
/** |
2 |
* @file RealSphericalHarmonic.hpp |
3 |
* @author Dan Gezelter |
4 |
* @date 10/18/2004 |
5 |
* @version 1.0 |
6 |
*/ |
7 |
|
8 |
#ifndef MATH_REALSPHERICALHARMONIC_HPP |
9 |
#define MATH_REALSPHERICALHARMONIC_HPP |
10 |
|
11 |
#include <string.h> |
12 |
|
13 |
#define RSH_SIN 0 |
14 |
#define RSH_COS 1 |
15 |
|
16 |
namespace oopse { |
17 |
class RealSphericalHarmonic { |
18 |
public: |
19 |
|
20 |
RealSphericalHarmonic(); |
21 |
virtual ~RealSphericalHarmonic() {} |
22 |
|
23 |
void setL(int theL) { L = theL; }; |
24 |
int getL() { return L; } |
25 |
|
26 |
void setM(int theM) { M = theM; }; |
27 |
int getM() { return M; } |
28 |
|
29 |
void setCoefficient(double co) {coefficient = co;} |
30 |
double getCoefficient() {return coefficient;} |
31 |
|
32 |
void setFunctionType(short int theType) {functionType = theType;} |
33 |
short int getFunctionType() { return functionType; } |
34 |
|
35 |
void makeSinFunction() {functionType = RSH_SIN;} |
36 |
void makeCosFunction() {functionType = RSH_COS;} |
37 |
|
38 |
bool isSinFunction() { return functionType == RSH_SIN ? true : false;} |
39 |
bool isCosFunction() { return functionType == RSH_COS ? true : false;} |
40 |
|
41 |
double getValueAt(double costheta, double phi); |
42 |
|
43 |
protected: |
44 |
|
45 |
double LegendreP (int l, int m, double x); |
46 |
|
47 |
int L; |
48 |
int M; |
49 |
short int functionType; |
50 |
double coefficient; |
51 |
|
52 |
}; |
53 |
} |
54 |
|
55 |
#endif |