Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace "latitude" with "colatitude" #16

Merged
merged 1 commit into from
Apr 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/Point3D.jl
Original file line number Diff line number Diff line change
Expand Up @@ -154,17 +154,17 @@ Return `Point3D(x, y, z)` corresponding to `(ρ, θ, ϕ)`:

- θ is the azimuthal angle (the longitude) 0 is +x, π is -x, 2π is +x

- ϕ is the polar angle (the latitude) 0 is North Pole, π is South Pole
- ϕ is the polar angle (the colatitude) 0 is North Pole, π is South Pole

There are two major conventions for spherical coordinate notation.

In physics books:

(ρ, θ, φ) gives the radial distance, polar angle (latitude), and azimuthal angle (longitude)
(ρ, θ, φ) gives the radial distance, polar angle (colatitude), and azimuthal angle (longitude)

In mathematics books:

(ρ, θ , φ ) gives the radial distance, azimuthal angle (longitude), and polar angle (latitude)
(ρ, θ , φ ) gives the radial distance, azimuthal angle (longitude), and polar angle (colatitude)

So we're using the mathematics one here.
"""
Expand All @@ -185,7 +185,7 @@ sphericaltocartesian((ρ, θ, ϕ)) = sphericaltocartesian(ρ, θ, ϕ)
"""
cartesiantospherical(x, y, z)

Return `(ρ, θ, ϕ)` (radius, longitude, latitude) of the Point3D(x, y, z).
Return `(ρ, θ, ϕ)` (radius, longitude, colatitude) of the Point3D(x, y, z).
"""
function cartesiantospherical(x, y, z)
ρ = sqrt(x^2 + y^2 + z^2)
Expand All @@ -197,7 +197,7 @@ end
"""
cartesiantospherical(pt::Point3D)

Return `(ρ, θ, ϕ)` (radius, longitude, latitude) of `pt`.
Return `(ρ, θ, ϕ)` (radius, longitude, colatitude) of `pt`.
"""
cartesiantospherical(pt::Point3D) = cartesiantospherical(pt.x, pt.y, pt.z)

Expand Down