Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Converting latitude/longitude to Cartesian coords?

  1. Apr 21, 2004 #1
    Does anyone have a quick method to do this?
     
  2. jcsd
  3. Apr 22, 2004 #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
     
  4. Apr 22, 2004 #3
    I believe [tex]z = \rho \cos{\phi}[/tex] and [tex]x = \rho \cos{\theta} \sin{\phi}[/tex] :smile:
     
  5. Apr 23, 2004 #4

    HallsofIvy

    User Avatar
    Staff Emeritus
    Science Advisor

    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.
     
  6. Apr 23, 2004 #5

    uart

    User Avatar
    Science Advisor


    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.
     
  7. Apr 26, 2004 #6

    HallsofIvy

    User Avatar
    Staff Emeritus
    Science Advisor

    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.
     
  8. Apr 26, 2004 #7

    uart

    User Avatar
    Science Advisor

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

     
  9. Apr 27, 2004 #8

    HallsofIvy

    User Avatar
    Staff Emeritus
    Science Advisor

    Aha! So instead of "America against the world", it is "Physicists against Mathematicians"!
     
  10. May 13, 2004 #9
    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).
     
  11. Oct 28, 2008 #10
    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
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?