sarkit.wgs84.cartesian_to_geodetic
- cartesian_to_geodetic(xyz)
Converts WGS 84 cartesian coordinates to geodetic coordinates.
- Parameters:
- xyz(…, 3) array_like
Array of cartesian coordinates with X, Y, Z components in meters in the last dimension.
- Returns:
- (…, 3)
ndarray Array of geodetic coordinates with [latitude (deg), longitude (deg), and ellipsoidal height (m)] in the last dimension.
- (…, 3)
Notes
The latitude and height are computed using Heikkinen’s algorithm [1].
References
[1]M. Heikkinen, “Geschlossene Formeln zur Berechnung raumlicher geodatischer Koordinaten aus rechtwinkligen Koordinaten”, Zeitschrift Vermess (in German), 107, pp. 207-211, 1982.
Examples
>>> import sarkit.wgs84 >>> sarkit.wgs84.cartesian_to_geodetic( ... [ ... [sarkit.wgs84.SEMI_MAJOR_AXIS, 0, 0], ... [0, sarkit.wgs84.SEMI_MAJOR_AXIS, 0], ... [0, 0, sarkit.wgs84.SEMI_MINOR_AXIS], ... ] ... ) array([[ 0., 0., 0.], [ 0., 90., 0.], [90., 0., 0.]])