Skip to content

Commit 18ba6ce

Browse files
Correct docs for sht
Ugly, but closes #40.
1 parent bb3cf89 commit 18ba6ce

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/SphericalHarmonics/SphericalHarmonics.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ doc"""
3232
Computes the bivariate Fourier series given by the spherical harmonic expansion:
3333
3434
```math
35-
{\rm SHT} : \sum_{\ell=0}^n\sum_{m=-\ell}^{\ell} f_{\ell}^m Y_{\ell}^m(\theta,\varphi) \to \sum_{\ell=0}^n\sum_{m=-n}^{n} g_{\ell}^m \frac{e^{{\rm i} m \varphi}}{\sqrt{2\pi}} \left\{\begin{array}{c}\cos\ell\theta\\ \sin(\ell+1)\theta\end{array}\right\},
35+
{\rm SHT} : \sum_{\ell=0}^n\sum_{m=-\ell}^{\ell} f_{\ell}^m Y_{\ell}^m(\theta,\varphi) \to \sum_{\ell=0}^n\sum_{m=-n}^{n} g_{\ell}^m \left\{\begin{array}{ccc}\cos\ell\theta & {\rm for} & m{\rm~even}\\ \sin(\ell+1)\theta & {\rm for} & m{\rm~odd}\end{array}\right\}\times \sqrt{\frac{2-\delta_{m,0}}{\pi}} \left\{\begin{array}{ccc} \cos m\varphi & {\rm for} & m \ge 0,\\ \sin(-m\varphi) & {\rm for} & m < 0.\end{array}\right.
3636
```
3737
38-
where the cosines are used when ``m`` is even and the sines are used when ``m`` is odd. The spherical harmonic expansion coefficients are organized as follows:
38+
The spherical harmonic expansion coefficients are organized as follows:
3939
4040
```math
4141
F = \begin{pmatrix}
@@ -66,10 +66,10 @@ doc"""
6666
Computes the spherical harmonic expansion given by the bivariate Fourier series:
6767
6868
```math
69-
{\rm iSHT} : \sum_{\ell=0}^n\sum_{m=-n}^{n} g_{\ell}^m \frac{e^{{\rm i} m \varphi}}{\sqrt{2\pi}} \left\{\begin{array}{c}\cos\ell\theta\\ \sin(\ell+1)\theta\end{array}\right\} \to \sum_{\ell=0}^n\sum_{m=-\ell}^{\ell} f_{\ell}^m Y_{\ell}^m(\theta,\varphi),
69+
{\rm iSHT} : \sum_{\ell=0}^n\sum_{m=-n}^{n} g_{\ell}^m \left\{\begin{array}{ccc}\cos\ell\theta & {\rm for} & m{\rm~even}\\ \sin(\ell+1)\theta & {\rm for} & m{\rm~odd}\end{array}\right\}\times \sqrt{\frac{2-\delta_{m,0}}{\pi}} \left\{\begin{array}{ccc} \cos m\varphi & {\rm for} & m \ge 0,\\ \sin(-m\varphi) & {\rm for} & m < 0,\end{array}\right. \to \sum_{\ell=0}^n\sum_{m=-\ell}^{\ell} f_{\ell}^m Y_{\ell}^m(\theta,\varphi).
7070
```
7171
72-
where the cosines are used when ``m`` is even and the sines are used when ``m`` is odd. The spherical harmonic expansion coefficients are organized as follows:
72+
The spherical harmonic expansion coefficients are organized as follows:
7373
7474
```math
7575
F = \begin{pmatrix}

src/SphericalHarmonics/sphfunctions.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,15 +87,15 @@ function maxcolnorm(A::AbstractMatrix)
8787
end
8888

8989
doc"""
90-
Pointwise evaluation of spherical harmonic:
90+
Pointwise evaluation of real orthonormal spherical harmonic:
9191
9292
```math
93-
Y_\ell^m(\theta,\varphi) = \frac{e^{{\rm i} m\varphi}}{\sqrt{2\pi}} {\rm i}^{m+|m|}\sqrt{(\ell+\frac{1}{2})\frac{(\ell-m)!}{(\ell+m)!}} P_\ell^m(\cos\theta).
93+
Y_\ell^m(\theta,\varphi) = (-1)^{|m|}\sqrt{(\ell+\frac{1}{2})\frac{(\ell-|m|)!}{(\ell+|m|)!}} P_\ell^{|m|}(\cos\theta) \sqrt{\frac{2-\delta_{m,0}}{\pi}} \left\{\begin{array}{ccc} \cos m\varphi & {\rm for} & m \ge 0,\\ \sin(-m\varphi) & {\rm for} & m < 0.\end{array}\right.
9494
```
9595
"""
9696
sphevaluate(θ, φ, L, M) = sphevaluatepi/π, φ/π, L, M)
9797

98-
sphevaluatepi::Number, φ::Number, L::Integer, M::Integer) = sphevaluatepi(θ,L,M)*sphevaluatepi(φ,M)
98+
sphevaluatepi::Number, φ::Number, L::Integer, M::Integer) = sphevaluatepi(θ, L, M)*sphevaluatepi(φ, M)
9999

100100
function sphevaluatepi::Number, L::Integer, M::Integer)
101101
ret = one(θ)/sqrt(two(θ))
@@ -120,4 +120,4 @@ function sphevaluatepi(θ::Number, L::Integer, M::Integer)
120120
end
121121
end
122122

123-
sphevaluatepi::Number, M::Integer) = complex(cospi(M*φ),sinpi(M*φ))/sqrt(two(φ)*π)
123+
sphevaluatepi::Number, M::Integer) = sqrt((two(φ)-δ(M, 0))/π)*(M 0 ? cospi(M*φ) : sinpi(-M*φ))

0 commit comments

Comments
 (0)