Longitude/ latitude to cartesian coordinates

Hello,

I have a file consist of some latitude/ longitudes and am looking forward to converting those geographical coordinates to cartesian coordinates. Has anyone any experience on this issue ?. There are plenty of scripts that convert the UTM format to cartesian coordinates, however, there are lack of scripts for converting latitude/longitude to cartesian coordinates...

Thanks in advance,
A
What is the origin and unit vectors of the coordinate system?
What do you mean ???
To make it clear I want to know if you just want to convert a latitude(-90° to 90°) and a longitude(-180° to 180°) into coordinates in a 3D space where the origin is the center of the earth of radius r.
I this case this should work:
1
2
3
x = r * cos(latitude) * cos(longitude);
y = r * cos(latitude) * sin(longitude);
z = r * sin(latitude);
Last edited on
This is accepted with the approximation that the earth is really a sphere. Realistically, the earth is a ellipsoid, and r is different for each compnent; i.e.,

1
2
3
x = a * sin(theta) * cos(phi);
y = b * sin(theta) * sin(phi);
z = c * cos(theta);


Your conversion is simply from spherical coordinates to cartesian coordinates. Refer to wikipedia for more information. You have to be good in trigonometric identities to do the conversions for earth.

http://en.wikipedia.org/wiki/Spherical_coordinate_system
Topic archived. No new replies allowed.