heyoka.model.cart2geo#
- heyoka.model.cart2geo(xyz: Iterable[expression], ecc2: float = 0.006694379990197619, R_eq: float = 6378137.0, n_iters: int = 4) list[expression] #
Transform Cartesian coordinates into geodetic coordinates.
Added in version 4.0.0.
Note
A tutorial showcasing also the use of this function is available.
This function will compute the expressions of the geodetic coordinates as functions of the input Cartesian coordinates using the Hirvonen and Moritz iterations (see “Physical Geodesy” by Heiskanen and Moritz, pp.181-183).
A few checks are run on the input arguments. Specifically:
the number of Cartesian variable (i.e., the length of xyz) must be three,
ecc2 must be finite and non-negative,
R_eq must be finite and positive,
n_iters must be positive.
The default values for R_eq and ecc2 are taken from the WGS84 model.
- Parameters:
xyz – expressions for the Cartesian components [units consistent with R_eq].
ecc2 – the reference ellipsoid eccentricity squared.
R_eq – the reference ellipsoid equatorial radius [units consistent with xyz].
n_iters – number of Hirvonen and Moritz iterations of the inversion algorithm.
- Returns:
the expressions for the geodetic coordinates [alt, lat, lon]. alt in the same units as xyz and R_eq, lat in \(\left[ -\frac{\pi}{2}, \frac{\pi}{2} \right]\) and lon in \(\left[ -\pi, \pi \right]\).
- Raises:
ValueError – if one or more input arguments are malformed, as explained above.