How To Convert XY Coordinates To Longitude And Latitude

The position of an object in XY coordinates is converted to longitude and latitude to get a better and clearer idea about the spot of the object on the surface of the earth. The position of an object can be expressed in a number of formats like the Military Grid Reference System (MGRS), Universal Transverse Mercator (UTM) system, geographic coordinate system that is latitude and longitude, and Universal Polar Stereographic (UPS). The geographic coordinate system is commonly used, as it is simple and easy to understand.

Converting from Cartesian coordinates to latitude and longitude

Ensure that your X, Y, and Z values are specified in the Cartesian coordinate system and assign values to these coordinates. Assume the value 6371 kilometers to the variable R, which is the approximate radius of Earth.

Calculate latitude and longitude using the formulas latitude = asin (Z/R) and longitude = atan2 (Y,X). In these formulas, we have already assigned the values of X, Y, Z, and R. Asin is arc sin, which is a mathematical function, and atan2 is a variation of the arc tangent function. 

The above two formulas are derived from some other formulas: X = R x cos(latitude) x cos(longitude); Y = R x cos(latitude) x sin(longitude); and z = R x sin(latitude). The value of atan2 can be calculated using the formula atan2(y, x) = 2atan(y/√(x²+y²)-x).

References

Recommended