pub struct Spherical<U: AngleUnit>(/* private fields */);Expand description
Spherical coordinates in unit U.
Mirrors boost::geometry::cs::spherical<DegreeOrRadian>
(boost/geometry/core/cs.hpp:115-135).
§Convention: latitude measured from the equator
Boost has two spherical tags
(boost/geometry/core/tags.hpp:38-41):
spherical_polar_tag— colatitude. The second coordinate is the angle from the pole, ranging[0, π].spherical_equatorial_tag— latitude. The second coordinate is the angle from the equator, ranging[-π/2, π/2].
v1 collapses both into one Spherical<U> family and picks the
equatorial convention because that is what the OGC standard
and the Boost.Geometry quickstart use
(doc/src/examples/quick_start.cpp Amsterdam → Paris example).
In coordinate order:
get::<0>(p) → longitude (azimuth, around the polar axis)
get::<1>(p) → latitude (measured from the equator)In a Spherical<Degree> point, longitude ranges -180.0..=180.0
(east of Greenwich is positive) and latitude ranges
-90.0..=90.0 (north of the equator is positive). Amsterdam
(≈ 4.90° E, 52.37° N) is (4.90, 52.37) — the “north of the
equator” component is the second coordinate.
§If you have colatitude data
Convert to latitude first: latitude = 90° − colatitude
(degrees) or π/2 − colatitude (radians). The dedicated
SphericalPolar / SphericalEquatorial split is deferred to a future iteration.
§Examples
use geometry_cs::{CoordinateSystem, Degree, Spherical, SphericalFamily};
fn _spherical<C: CoordinateSystem<Family = SphericalFamily>>() {}
_spherical::<Spherical<Degree>>();