From Geographical coordinates to Cartesian coordinates

  • I
  • Thread starter Aleoa
  • Start date
  • #1
128
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?
 

Answers and Replies

  • #2
Matternot
Gold Member
129
8
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°...
 
  • #3
128
5
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 ?
 
  • #4
Matternot
Gold Member
129
8
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.
 
  • #5
35,264
11,519
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.
 
  • #6
pbuk
Science Advisor
Gold Member
2,036
807
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.
 
  • #7
## 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:
  • #8
128
5
## 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 ?
 
  • #9
pbuk
Science Advisor
Gold Member
2,036
807
take a by direct measurement.
Of what?
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.
 

Related Threads on From Geographical coordinates to Cartesian coordinates

Replies
2
Views
14K
Replies
5
Views
4K
  • Last Post
Replies
2
Views
1K
  • Last Post
Replies
2
Views
2K
Replies
3
Views
1K
  • Last Post
Replies
1
Views
2K
Replies
5
Views
13K
Replies
2
Views
4K
Replies
9
Views
4K
Replies
1
Views
6K
Top