# From Geographical coordinates to Cartesian coordinates

• I
I have 2 points expressed in (latitude,longitude) and I want to calculate the angle with respect to the north pole.

Since the two points are very near (like hundred of meters), is it possible to consider the two points in the carthesian system simply as:

x=longitude
y=latitude

Then applying $\arctan(y/x)$, I get the angle from the equator and so, summing this angle to (-90°) i get the bearing (angle from north pole).

Is this correct?

Matternot
Gold Member
Locally, it is possible to express coordinates on the surface of a sphere with Cartesian coordinates and work with those, but it seems unnecessary. There is an easier solution. Perhaps try drawing a diagram. Also, the angles in a triangle on the surface of a sphere don't add up to 180°...

Locally, it is possible to express coordinates on the surface of a sphere with Cartesian coordinates and work with those, but it seems unnecessary. There is an easier solution. Perhaps try drawing a diagram. Also, the angles in a triangle on the surface of a sphere don't add up to 180°...

I wasn't clear in the main post. I simply need to calculate the direction of a moving car given two points in the map and i want to express this direction using the angle from the north pole.
Is the solution i proposed correct ?

Matternot
Gold Member
In this case, it seems clear that they expect you to assume that locally, coordinates are Cartesian and hence, a bearing is probably what they expect. i.e. North is y axis, East is x axis.

mfb
Mentor
Use the arctan, but use it for the difference of the coordinates: The length north/east from one point to the other. This is not directly the difference in coordinates but it is quick to calculate from them.

pbuk
Gold Member
This is only going to work near the equator. Transforming latitude to the y-axis in this way is called the “equirectangular projection” and does not preserve bearing. You need to use a Mercator projection.

## Cosθ = \frac { Cos(a/R) - Cos(b/R).Cos(c/R)} { Sin(b/R).Sin(c/R)} ##

R is the radius of the Earth. You find b and c directly from Latitude expressed in Radians, viz. b = (π/2-Latitude)R etc.

Since the points are very close together you said, you expect the line joining them to be a geodesic, so take a by direct measurement. The angle θ is what you need.

Longitude is not needed in the calculations.

Last edited:
## Cosθ = \frac { Cos(a/R) - Cos(b/R).Cos(c/R)} { Sin(b/R).Sin(c/R)} ##

R is the radius of the Earth. You find b and c directly from Latitude expressed in Radians, viz. b = (π/2-Latitude)R etc.

Since the points are very close together you said, you expect the line joining them to be a geodesic, so take a by direct measurement. The angle θ is what you need.

Longitude is not needed in the calculations.

Hi, in which way the cosine formula you writed has to be used ?

pbuk