1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
//! Reference ellipsoid for geographic coordinate systems.
//!
//! Mirrors `boost::geometry::srs::spheroid<RadiusType>` from
//! `boost/geometry/srs/spheroid.hpp`. Boost stores the spheroid as a
//! pair of radii (`m_a`, `m_b`) and exposes them via a
//! `get_radius<I>()` template; we store the *flattening* alongside the
//! equatorial radius instead, because every geodesic formula
//! (Andoyer, Vincenty, Thomas) needs `f` directly — keeping it as the
//! primary stored field avoids the round-trip through `(a − b) / a`
//! that Boost's strategies do at every call site.
//!
//! `WGS84` is the only reference we ship in this task; other ellipsoids
//! (GRS80, IUGG67, …) land alongside the geographic strategies in T42.
/// Reference ellipsoid for geographic coordinate systems.
///
/// Field semantics match Boost's `srs::spheroid<T>`
/// (`boost/geometry/srs/spheroid.hpp:49-112`), except the second
/// stored value is the *flattening* instead of the polar radius — the
/// two forms are interconvertible via [`polar_radius`] /
/// [`flattening`] but `f` is what the geodesic formulas actually take
/// as input.
///
/// [`polar_radius`]: Spheroid::polar_radius
/// [`flattening`]: Spheroid::flattening
///
/// # Examples
///
/// ```
/// use geometry_cs::Spheroid;
/// let s = Spheroid::WGS84;
/// assert_eq!(s.equatorial_radius, 6_378_137.0);
/// // The WGS84 polar radius is ~6 356 752.3 m.
/// assert!((s.polar_radius() - 6_356_752.314_245).abs() < 0.01);
/// ```