[rv, elong, phi, height] = ERFA.gc2gde( a, f, xyz)
Transform geocentric coordinates to geodetic for a reference ellipsoid of specified form.
a double equatorial radius (Notes 2,4)
f double flattening (Note 3)
xyz double[3] geocentric vector (Note 4)
elong double longitude (radians, east +ve)
phi double latitude (geodetic, radians)
height double height above ellipsoid (geodetic, Note 4)
int status: 0 = OK
-1 = illegal f
-2 = illegal a
-
This function is based on the GCONV2H Fortran subroutine by Toshio Fukushima (see reference).
-
The equatorial radius, a, can be in any units, but meters is the conventional choice.
-
The flattening, f, is (for the Earth) a value around 0.00335, i.e. around 1/298.
-
The equatorial radius, a, and the geocentric vector, xyz, must be given in the same units, and determine the units of the returned height, height.
-
If an error occurs (status < 0), elong, phi and height are unchanged.
-
The inverse transformation is performed in the function eraGd2gce.
-
The transformation for a standard ellipsoid (such as ERFA_WGS84) can more conveniently be performed by calling eraGc2gd, which uses a numerical code to identify the required A and F values.
Fukushima, T., "Transformation from Cartesian to geodetic coordinates accelerated by Halley's method", J.Geodesy (2006) 79: 689-693
This revision: 2021 May 11
Copyright (C) 2013-2021, NumFOCUS Foundation. Derived, with permission, from the SOFA library.