XLPack 7.0
XLPack Numerical Library (Excel VBA) Reference Manual
Loading...
Searching...
No Matches

◆ Sharmonicr_sub()

Sub Sharmonicr_sub ( Ret As  Double,
L As  Long,
M As  Long,
Theta As  Double,
Phi As  Double,
Optional Info As  Long 
)

Real part of spherical harmonic Ylm(θ, φ) (Subroutine version)

Purpose
Computes the real part of 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).
Parameters
[out]RetReal part of spherical harmonic Ylm(θ, φ).
[in]LDegree l. (0 <= L < 128)
[in]MOrder m. (|M| <= L)
[in]ThetaPolar angle θ.
Generally use theta in the range [0, π]. For theta outside this range, the result may be different from the other implementation.
[in]PhiAzimuth φ.
Generally use phi in the range [0, 2π]. For phi outside this range, the result may be different from the other implementation.
[out]Info(Optional)
= 0: Successful exit.
= -1: The argument L had an illegal value. (L < 0, L >= 128)
= -2: The argument M had an illegal value. (|M| > L)
= 1: Floating point range error.
Reference
boost/math/special_functions