|
|
◆ sharmonic_sub()
| void sharmonic_sub |
( |
unsigned int |
l, |
|
|
int |
m, |
|
|
double |
theta, |
|
|
double |
phi, |
|
|
std::complex< double > * |
z |
|
) |
| |
Spherical harmonic Ylm(θ, φ)
- Purpose
- sharmonic_sub computes the spherical harmonic of degree l, order m, polar angle θ and azimuth φ.
Ylm(θ, φ) = [(2l + 1)/4π (l - m)!/(l + m)!]^(1/2) Plm(cosθ)exp(imφ), where m <= l.
Plm(x) is an associated Legendre polynomial. Note that the phase factor of (-1)^m is included in Plm(x).
sharmonic_sub is the subroutine version of sharmonic.
- Parameters
-
| [in] | l | Degree l. |
| [in] | m | Order m. (|m| <= l) |
| [in] | theta | Polar angle θ.
Generally use theta in the range [0, π]. For theta outside this range, the result may be different from other implementation. |
| [in] | phi | Azimuth φ.
Generally use phi in the range [0, 2π]. For phi outside this range, the result may be different from other implementation. |
| [out] | z | Spherical harmonic Ylm(θ, φ). |
- Error handling
- If |m| > l, domain error (EDOM) occurs.
- Range error (ERANGE) may occur.
- Note
- Note that the worst errors occur when the degree increases, values greater than ~120 are very unlikely to produce sensible results, especially when the order is also large. Further the relative errors are likely to grow arbitrarily large when the function is very close to a root.
- Reference
- boost/math/special_functions
|