Converting latitude/longitude to Cartesian coords?

  • Thread starter kronchev
  • Start date
  • Tags
    Cartesian
In summary, there are various methods for converting coordinates on a sphere or spheroid, including the use of spherical coordinates with the equations x = ρsinθcosφ, y = ρsinθsinφ, and z = ρcosθ, where φ is the longitude, θ is the latitude, and ρ is the radius of the Earth. However, there may be confusion regarding the conventions for labeling these angles, with some texts and sources using the symbols φ and θ in reverse. Additionally, there is a "quick and dirty" method for converting coordinates on a perfect sphere, and a more complex method involving solving a quartic equation.
  • #1
kronchev
31
0
Does anyone have a quick method to do this?
 
Mathematics news on Phys.org
  • #2
It's just a straight application of the spherical coordinate transformation.

[tex]x = \rho \sin{\theta} \cos{\phi}[/tex]
[tex]y = \rho \sin{\theta} \sin{\phi}[/tex]
[tex]z = \rho \cos{\theta}[/tex]

Where [itex]\phi[/itex] is the longitude, [itex]\theta[/itex] is the latitude, and [itex]\rho[/itex] is the radius of the Earth.

cookiemonster
 
  • #3
cookiemonster said:
It's just a straight application of the spherical coordinate transformation.

[tex]x = \rho \sin{\theta} \cos{\phi}[/tex]
[tex]y = \rho \sin{\theta} \sin{\phi}[/tex]
[tex]z = \rho \cos{\theta}[/tex]

Where [itex]\phi[/itex] is the longitude, [itex]\theta[/itex] is the latitude, and [itex]\rho[/itex] is the radius of the Earth.

cookiemonster
I believe [tex]z = \rho \cos{\phi}[/tex] and [tex]x = \rho \cos{\theta} \sin{\phi}[/tex] :smile:
 
  • #4
Though I suspect that our original poster wanted 2 dimensional coordinates: like a flat map. Of course, you can't do that: no flat map of the world can be an isometric representation of the sphere. You would need to specify how that is to be handled.
 
  • #5
deltabourne said:
I believe [tex]z = \rho \cos{\phi}[/tex] and [tex]x = \rho \cos{\theta} \sin{\phi}[/tex] :smile:


All you're doing there deltabourne is interchanging the values of theta and phi in cookiemonsters definition. Theta is normally used to denote the angle from the positve z axis and with that definition of theta cookiemonsters equations are correct.
 
  • #6
Maybe this is an "America against the rest of the world" thing but every text I've ever seen defines φ to be the angle the straight line from (0,0,0) to the point makes with the positive z axis while θ is the angle the projection of that line onto the xy-plane makes with the positive x-axis.
 
  • #7
HallsofIvy said:
Maybe this is an "America against the rest of the world" thing but every text I've ever seen defines φ to be the angle the straight line from (0,0,0) to the point makes with the positive z axis while θ is the angle the projection of that line onto the xy-plane makes with the positive x-axis.

Yes it looks like both conventions are in common use unfortunately. Here is what Mathworld has to say about it.

MathWorld said:
A system of curvilinear coordinates which is natural for describing positions on a sphere or spheroid. Define [tex]\theta[/tex] to be the azimuthal angle in the xy-plane from the x-axis and [tex]\phi[/tex] to be the polar angle from the z-axis with ...

Unfortunately, the convention in which the symbols and are reversed is frequently used, especially in physics, leading to unnecessary confusion. The symbol [tex]\rho[/tex] is sometimes also used in place of r. Arfken (1985) uses [tex](r, \phi, \theta)[/tex], whereas Beyer (1987) uses [tex](\rho, \theta, \phi)[/tex]. Be very careful when consulting the literature.
 
  • #8
Aha! So instead of "America against the world", it is "Physicists against Mathematicians"!
 
  • #9
kronchev said:
Does anyone have a quick method to do this?

The 'quick and dirty' method (assuming the Earth is a perfect sphere):

x = longitude*60*1852*cos(latitude)
y = latitude*60*1852

Latitude and longitude must be in decimal degrees, x and y are in meters.
The origin of the xy-grid is the intersection of the 0-degree meridian and the equator, where x is positive East and y is positive North.

So, why the 1852? I'm using the (original) definition of a nautical mile here: 1 nautical mile = the length of one arcminute on the equator (hence the 60*1852; I'm converting the lat/lon degrees to lat/lon minutes).
 
  • #10
kronchev said:
Does anyone have a quick method to do this?

X = (N+H) cos(phi) cos(lambda)
Y = (N+H) cos(phi) sin(lambda)
Z = [N(1-e^2)+H] sin(phi)

I have solved the inverse problem analytically as well as with other better methods.
This involves solving a complicated quartic eqation. See Vanicek & Krakiwsky, Geodesy.
There are other less efficient methods online. See Mathworks, e.g.

Ben Palmer
 

1. What is the purpose of converting latitude/longitude to Cartesian coordinates?

The purpose of converting latitude/longitude to Cartesian coordinates is to express geographic locations in a format that is easier to work with mathematically. This conversion allows for distance and direction calculations, as well as plotting points on a two-dimensional plane.

2. How do you convert latitude/longitude to Cartesian coordinates?

To convert latitude/longitude to Cartesian coordinates, you can use the following formula:x = R * cos(lat) * cos(lon)y = R * cos(lat) * sin(lon)z = R * sin(lat)Where R is the radius of the Earth, lat is the latitude in radians, and lon is the longitude in radians.

3. What is the difference between latitude/longitude and Cartesian coordinates?

Latitude/longitude coordinates are used to identify a location on a spherical surface, such as the Earth. Cartesian coordinates, on the other hand, represent a location on a two-dimensional plane. While latitude/longitude use angles and distance from a reference point, Cartesian coordinates use x and y coordinates from a fixed origin point.

4. Are there any limitations to converting latitude/longitude to Cartesian coordinates?

Yes, there are limitations to converting latitude/longitude to Cartesian coordinates. This conversion assumes a spherical Earth, which is not entirely accurate. Additionally, the formula does not account for changes in elevation, which can affect the accuracy of the coordinates. It is also important to note that this conversion only works for locations on the Earth's surface, not for points in the Earth's interior.

5. In what fields or industries is converting latitude/longitude to Cartesian coordinates commonly used?

Converting latitude/longitude to Cartesian coordinates is commonly used in the fields of geography, geology, cartography, and navigation. It is also used in industries such as transportation, surveying, and GIS (Geographic Information Systems). Additionally, it is used in various mapping and GPS applications.

Similar threads

Replies
13
Views
2K
Replies
7
Views
156
Replies
8
Views
2K
Replies
2
Views
1K
Replies
3
Views
1K
Replies
1
Views
2K
  • General Math
Replies
1
Views
3K
  • General Math
Replies
7
Views
2K
  • General Math
Replies
1
Views
1K
  • General Math
Replies
10
Views
1K
Back
Top