From Geographical coordinates to Cartesian coordinates

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
8 replies · 2K views
Aleoa
Messages
128
Reaction score
5
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 [itex]\arctan(y/x)[/itex], 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?
 
Mathematics news on Phys.org
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°...
 
Matternot said:
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 ?
 
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.
 
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.
 
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:
Rada Demorn said:
## 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 ?
 
Rada Demorn said:
take a by direct measurement.
Of what?
Rada Demorn said:
Longitude is not needed in the calculations.
It is needed to calculate a, if using your formula. Personally I think transforming to Cartesian coordinates is more intuitive, you just need to use the Mercator transformation to get the right y coordinate. Google will help here.