Converts a Cartesian coordinate to a Geodetic coordinate on the user defined reference ellipsoid.
true - if the conversion succeeded, false - if the conversion failed
The function verifies validity of the input arguments before running the conversion. The valid Cartesian X, Y, Z are real numbers. X, Y and Z cannot be equal to zero at the same time. X and Y cannot be equal to zero at the same time.
This sample shows how to call the Cartesian.ConvertCartesianToGeodetic method from C# code:
string errorMessage = String.Empty;
double semiMajorAxisA = 6378137;
double inverseFlattening = 298.257223563;
double xInM = 1114120.60285998;
double yInM = -4844685.62652945;
double zInM = 3982807.8497531;
double latInDeg = Double.NaN;
double lonInDeg = Double.NaN;
double hInM = Double.NaN;
if (Cartesian.ConvertCartesianToGeodetic(semiMajorAxisAInM, inverseFlattening, xInM, yInM, zInM, out latInDeg, out lonInDeg, out hInM, out errorMessage))
{
Console.WriteLine("Conversion succeeded.");
Console.WriteLine("LatInDeg: " + latInDeg.ToString());
Console.WriteLine("LonInDeg: " + lonInDeg.ToString());
Console.WriteLine("HeightInM: " + hInM.ToString());
}
else
{
Console.WriteLine("Conversion failed. " + errorMessage);
}
Cartesian Class | ApsGis Namespace | Cartesian.ConvertCartesianToGeodetic Overload List