|
GeographicLib 2.6
|
A triaxial ellipsoid. More...
#include <GeographicLib/Triaxial/Ellipsoid3.hpp>
Public Types | |
| using | vec3 = std::array<Math::real, 3> |
Public Member Functions | |
| Ellipsoid3 () | |
| Ellipsoid3 (real a, real b, real c) | |
| Ellipsoid3 (real b, real e2, real k2, real kp2) | |
Inspector functions | |
| real | a () const |
| real | b () const |
| real | c () const |
| real | e2 () const |
| real | k2 () const |
| real | kp2 () const |
Coordinate conversions. | |
| void | cart2toellip (vec3 R, Angle &bet, Angle &omg) const |
| void | cart2toellip (vec3 R, vec3 V, Angle &bet, Angle &omg, Angle &alp) const |
| void | cart2toellip (Angle bet, Angle omg, vec3 V, Angle &alp) const |
| void | elliptocart2 (Angle bet, Angle omg, vec3 &R) const |
| void | elliptocart2 (Angle bet, Angle omg, Angle alp, vec3 &R, vec3 &V) const |
Static Public Member Functions | |
| static const Ellipsoid3 & | Earth () |
Normalizing functions | |
| void | Norm (vec3 &R) const |
| void | Norm (vec3 &R, vec3 &V) const |
| static bool | AngNorm (Angle &bet, Angle &omg, Angle &alp, bool alt=false) |
| static bool | AngNorm (Angle &bet, Angle &omg, bool alt=false) |
A triaxial ellipsoid.
The class holds the basic information about a triaxial ellipoid given by
\[ S(\mathbf R) = \frac{X^2}{a^2} + \frac{Y^2}{b^2} + \frac{Z^2}{c^2} - 1 = 0, \]
where the semiaxes satisfy \( a \ge b \ge c > 0\). It is useful to characterize the shape of the ellipsoid by
\[\begin{align} e &= \frac{\sqrt{a^2-c^2}}b,\\ k &= \frac{\sqrt{b^2-c^2}}{\sqrt{a^2-c^2}},\\ k' &= \frac{\sqrt{a^2-b^2}}{\sqrt{a^2-c^2}}; \end{align} \]
note that \(k^2 + k'^2 = 1\). The spherical limit \( e\rightarrow 0 \) is nonuniform since the values of \(k\) and \(k'\) depend on how the limit is taken. In this cases, it's convenient to specify the ellipsoid in terms of these parameters. The semiaxes are related to these parameters by
\[[a,b,c] = b \bigl[ \sqrt{1 + e^2k'^2}, 1, \sqrt{1 - e^2k^2} \bigr]. \]
Positions on the ellipsoid are given in term so the ellipsoidal latitude \(\beta\) and the ellipsoidal longitude \(\omega\) which are defined by
\[\mathbf R = \begin{bmatrix} a \cos\omega \sqrt{k^2\cos^2\beta + k'^2} \\ b \cos\beta \sin\omega \\ c \sin\beta \sqrt{k^2 + k'^2\sin^2\omega} \end{bmatrix}. \]
Headings are given by the direction \( \alpha \) measured clockwise from a line of constant \( \omega \). Conversions between Cartesian and elliopsoidal coordinates is provided by cart2toellip() and elliptocart2().
The ellipsoid coordinates "cover" the ellipsoid twice; the replacement
\[\begin{align} \omega & \rightarrow -\omega,\\ \beta & \rightarrow \pi-\beta,\\ \alpha & \rightarrow \pi+\alpha, \end{align} \]
leaves the position and direction unchanged; see AngNorm(),
Example of use:
Definition at line 82 of file Ellipsoid3.hpp.
| using GeographicLib::Triaxial::Ellipsoid3::vec3 = std::array<Math::real, 3> |
A type to hold three-dimentional positions and directions in Cartesian coordinates.
Definition at line 88 of file Ellipsoid3.hpp.
| GeographicLib::Triaxial::Ellipsoid3::Ellipsoid3 | ( | ) |
The default constructor for a unit sphere in the oblate limit.
Definition at line 17 of file Ellipsoid3.cpp.
References Ellipsoid3().
Referenced by Earth(), and Ellipsoid3().
| GeographicLib::Triaxial::Ellipsoid3::Ellipsoid3 | ( | real | a, |
| real | b, | ||
| real | c ) |
An ellipsoid specified by its semiaxes.
| [in] | a | the major semiaxis. |
| [in] | b | the median semiaxis. |
| [in] | c | the minor semiaxis. |
| GeographicErr | if the required ordering is semiaxes is violated. |
The semiaxes must satisfy a ≥ b ≥ c > 0. If a = c (a sphere), then the oblate limit is taken.
Definition at line 21 of file Ellipsoid3.cpp.
References a(), b(), c(), and GeographicLib::Math::sq().
| GeographicLib::Triaxial::Ellipsoid3::Ellipsoid3 | ( | real | b, |
| real | e2, | ||
| real | k2, | ||
| real | kp2 ) |
An ellipsoid specified by its median semiaxis and shape.
| [in] | b | the middle semi-axis. |
| [in] | e2 | the eccentricity squared \(e^2 = (a^2 - c^2)/b^2\). |
| [in] | k2 | the oblateness parameter squared \(k^2 = (b^2 - c^2) / (a^2 - c^2)\). |
| [in] | kp2 | the prolateness parameter squared \(k'^2= (a^2 - b^2) / (a^2 - c^2)\). |
| GeographicErr | if the required ordering is semiaxes is violated. |
This form of the constructor is important when the eccentricity is small and giving e2 allows for more precision.
In the case of a sphere with e2 = 0, this constructor distinguishes between and "oblate sphere" (k2 = 1), a "prolate sphere" (k2 = 0), and a "triaxial sphere" (k2 &isin (0,1)). These distinctions matter when ellipsoidal coordinates are used.
Definition at line 46 of file Ellipsoid3.cpp.
|
inline |
Definition at line 182 of file Ellipsoid3.hpp.
Referenced by Ellipsoid3().
|
inline |
Definition at line 186 of file Ellipsoid3.hpp.
Referenced by Ellipsoid3(), Ellipsoid3(), and GeographicLib::Triaxial::Conformal3::ForwardOther().
|
inline |
Definition at line 190 of file Ellipsoid3.hpp.
Referenced by Ellipsoid3().
|
inline |
Definition at line 194 of file Ellipsoid3.hpp.
Referenced by Ellipsoid3().
|
inline |
Definition at line 198 of file Ellipsoid3.hpp.
Referenced by Ellipsoid3().
|
inline |
Definition at line 202 of file Ellipsoid3.hpp.
Referenced by Ellipsoid3().
| void GeographicLib::Triaxial::Ellipsoid3::Norm | ( | vec3 & | R | ) | const |
Scale a position to ensure it lies on the ellipsoid
| [in,out] | R | the position. |
The components of R are scaled so that it lies on the ellipsoid. The resulting position is not in general the closest point on the ellipsoid. Use Cartesian3::carttocart2() for that.
Definition at line 67 of file Ellipsoid3.cpp.
References GeographicLib::Math::hypot3().
Referenced by Norm().
Scale a position and direction to the ellipsoid
| [in,out] | R | the position. |
| [in,out] | V | the position. |
The components of R are scaled so that it lies on the ellipsoid. Then V is projected to be tangent to the surface and is normalized to a unit vector.
Definition at line 73 of file Ellipsoid3.cpp.
References Norm(), and GeographicLib::Math::sq().
|
inlinestatic |
Set the sheet for coordinates.
| [in,out] | bet | the ellipsoidal latitude. |
| [in,out] | omg | the ellipsoidal longitude. |
| [in,out] | alp | the heading. |
| [in] | alt | if true switch to the alternate sheet. |
If alt = false (the default), the conventional sheet is used switching the values of bet, omg, and alp, so that bet ∈ [-π/2, &pi/2].
If alt = true, the alternate sheet is used switching the values of bet, omg, and alp, so that omg ∈ [0, π].
This routine does not change n (the number of turns) for the coordinates.
Definition at line 247 of file Ellipsoid3.hpp.
References GeographicLib::AngleT< T >::c(), and GeographicLib::AngleT< T >::s().
Referenced by GeographicLib::Triaxial::Geodesic3::Inverse(), GeographicLib::Triaxial::GeodesicLine3::pos1(), GeographicLib::Triaxial::GeodesicLine3::Position(), and GeographicLib::Triaxial::Conformal3::ReverseSphere().
|
inlinestatic |
Set the sheet for coordinates.
| [in,out] | bet | the ellipsoidal latitude. |
| [in,out] | omg | the ellipsoidal longitude. |
| [in] | alt | if true switch to the alternate sheet. |
This acts precisely the same and AngNorm(Angle&, Angle&, Angle&, bool) except that alp is omitted.
Definition at line 267 of file Ellipsoid3.hpp.
References GeographicLib::AngleT< T >::c(), and GeographicLib::AngleT< T >::s().
Convert a Cartesian position to ellipsoidal coordinates.
| [in] | R | the Cartesian position. |
| [out] | bet | the ellipsoidal latitude. |
| [out] | omg | the ellipsoidal longitude. |
Definition at line 112 of file Ellipsoid3.cpp.
Referenced by cart2toellip().
| void GeographicLib::Triaxial::Ellipsoid3::cart2toellip | ( | vec3 | R, |
| vec3 | V, | ||
| Angle & | bet, | ||
| Angle & | omg, | ||
| Angle & | alp ) const |
Convert a Cartesian position and direction to ellipsoidal coordinates.
| [in] | R | the Cartesian position. |
| [in] | V | the Cartesian direction. |
| [out] | bet | the ellipsoidal latitude. |
| [out] | omg | the ellipsoidal longitude. |
| [out] | alp | the azimuth. |
Definition at line 169 of file Ellipsoid3.cpp.
References cart2toellip().
| void GeographicLib::Triaxial::Ellipsoid3::cart2toellip | ( | Angle | bet, |
| Angle | omg, | ||
| vec3 | V, | ||
| Angle & | alp ) const |
Convert an ellipsoid position and Cartesian direction to a heading.
| [in] | bet | the ellipsoidal latitude. |
| [in] | omg | the ellipsoidal longitude. |
| [in] | V | the Cartesian direction. |
| [out] | alp | the azimuth. |
This is a variant of cart2toellip(vec3, vec3, Angle&, Angle&, Angle&) where bet and omg are used to ensure that the correct sheet is used in determining alp.
Definition at line 116 of file Ellipsoid3.cpp.
References GeographicLib::AngleT< T >::c(), GeographicLib::Math::norm(), and GeographicLib::AngleT< T >::s().
Convert ellipsoidal coordinates to a Cartesian position.
| [in] | bet | the ellipsoidal latitude. |
| [in] | omg | the ellipsoidal longitude. |
| [out] | R | the Cartesian position. |
Definition at line 176 of file Ellipsoid3.cpp.
References GeographicLib::AngleT< T >::c(), and GeographicLib::AngleT< T >::s().
Referenced by elliptocart2().
| void GeographicLib::Triaxial::Ellipsoid3::elliptocart2 | ( | Angle | bet, |
| Angle | omg, | ||
| Angle | alp, | ||
| vec3 & | R, | ||
| vec3 & | V ) const |
Convert coordinates and heading to a Cartesian position and direction.
| [in] | bet | the ellipsoidal latitude. |
| [in] | omg | the ellipsoidal longitude. |
| [in] | alp | the azimuth. |
| [out] | R | the Cartesian position. |
| [out] | V | the Cartesian direction. |
Definition at line 183 of file Ellipsoid3.cpp.
References GeographicLib::AngleT< T >::c(), elliptocart2(), and GeographicLib::AngleT< T >::s().
|
static |
A global instantiation of Ellipsoid3 with the parameters for the Earth.
Definition at line 226 of file Ellipsoid3.cpp.
References Ellipsoid3(), GeographicLib::Constants::Triaxial_Earth_a(), GeographicLib::Constants::Triaxial_Earth_b(), and GeographicLib::Constants::Triaxial_Earth_c().