int tsmGeocentricToLatLong ( double x, double y, double z, double *lat, double *lon, double *altitude )

Convert a geocentric coordinate into lat/long

Documentation

Convert a geocentric coordinate into lat/long.

This function will take a geocentric (x,y,z) coordinate and convert it into a (latitude,longitude,altitude) coordinate. The origin of the geocentric system is assumed to be at the center of the spheroid. The equator is in the x-y plane and 0 degrees of longitude lies along the x-z plane.

The lat/long values are returned in units of degrees relative to the WGS84 datum and in the range -90..+90, -180..+180, respectively.

The value for altitude is returned in units of meters above sea level (i.e. height above the geoid). If you wish altitude in terms of height above the WGS84 spheroid then you can add the geoid separation value for the region to the results obtained from this function, i.e.

altitude += (double) tspCalcGeoidSeparation( lat, lon );

Returns:
TRUE
Parameters:
x - the geocentric x coordinate
y - the geocentric y coordinate
z - the geocentric z coordinate
lat - reference to value to contain the WGS84 latitude (degrees)
lon - reference to value to contain the WGS84 longitude (degrees)
altitude - reference to value to contain the altitude above sea level (meters)
Author:
Martin Reddy
Version:
5 May 1998
See Also:
tspLatLongToGeocentric, tsmLatLongToUTM, tsmUTMToLatLong, tspCalcGeoidSeparation


TSMAPI_RELEASE 2.1 - Release Date: 2001/01/10 19:01:12

Back to tsmApi Home Page