1
$\begingroup$

When I was looking for info on converting latitude/longitude to $(x,y)$ Cartesian coordinates, I found this link on Doctor Math.

I found this following formula:

In Radians: $x = (\text{lon}_2 - \text{lon}_1)\times \cos(\text{lat}_1)\times \frac{\pi}{180}$ $y = (\text{lat}_2-\text{lat}_1)\times \frac{\pi}{180}$

In miles: $x = (\text{lon}_2-\text{lon}_1)\times \cos(\text{lat}_1)\times \frac{\pi \times R}{180}$ $y = (\text{lat}_2-\text{lat}_1)\times \frac{\pi\times R}{180}$

And :

$\text{lat}_2 = \text{lat}_1 + y\times \frac{180}{\pi\times R}$ $\text{lon}_2 = \text{lon}_1 + x\times \frac{180}{\pi\times R\times \cos(\text{lat}_1)}$

The Question:

Why converting to radian or degree for finding x,y?
Are there any references that explain the previous conversion formula?

Thank you :)

  • 0
    Without actually looking carefully at the formulas, my first guess is that they assume that latitude and longitude are in degrees and the $\pi$ and 180 factors are there because there's some kind of arclength computation going on.2011-06-26

1 Answers 1

3

Information from source linked by the OP:

For the y coordinate, we can use the north-south distance between two lines of latitude:

$y = \frac{\pi R(b_2-b_1)}{180}$

Here, I have converted the latitude difference, (b2-b1), from degrees to radians, by multiplying it by ($\pi$ radians)/($180$ degrees). The product of the angle in radians and the radius is the arc length in same units as the radius.

For the x coordinate, we can use the distance along a line of latitude from one line of longitude to the other:

$x = \frac{\pi R(a_2-a_1)\cos(b_1)}{180}$

Here we have an additional factor, the cosine of the latitude along which we are measuring. The line of latitude is a circle with a smaller radius than that of the equator; it is reduced by the factor $\cos(b_1)$ [$= \cos(\text{lat}_1)$] (brackets mine).

Thus, you see that I have set up a coordinate system (x,y) that puts one of the points of interest at the origin. The distance from the origin to any other point (x,y) is the square root of $(x^2 + y^2)$.

[$R$ here refers to the earth's radius]


I think you misunderstood/mistyped the formulas given in the link you provided in your question, as posted. The use of R (radius) and $\frac {\pi}{180}$ in the equation gives the representation of x and y in the units in which radius $R$ is measured. (As Isaac notes in his comment: latitude and longitude are expressed in degrees, and to get the correct corresponding x and y coordinate, we must convert from degrees. I'm no sure why you added formulas for "in radians", for this is not in the source you linked.

As for references:

  • For some literature providing a more in-depth explanation on converting geodesic coordinates to Cartesian coordinates, and the other way around see: geodetic $\iff$ cartesion, pdf.

  • For converting Cartesian coordinates to Geodetic (e.g. latitude, longitude), see also cartesian to geodetic, pdf.

  • For an on-line conversion tool (i.e., converts geodetic $\iff$ cartesian) coordinates, see: online conversion tool. It can convert to and from any number of geodetic representations. (See conversion tool, linked above, for menu choices.)