Reputation: 2422
I've got two LatLon (latitude-longitude) objects which represent two locations on the surface of the globe. I want to find the angle (in radians) between the center of the earth and these two LatLon objects.
I'm going to use this angle and the radius of the earth to calculate the arc length between the two locations (I figure this will give better precision than using simple Pythagoras, and be faster than computing the great circle distance).
I already have code to give me the Pythagorean distance and the great circle distance.
Upvotes: 1
Views: 3236
Reputation: 2205
I thought this at first (after some calc on paper) is this Pythagorean thing?
angle_between_radian = sqrt(deltaLA^2 + deltaLO^2)*PI /180
edit: delta = delta>180?360-delta:delta
We working on sphere then above must wrong ^^.
But this link may help:Calculate distance, bearing and more between Latitude/Longitude points.
Upvotes: -2
Reputation: 7493
Using something like this - how to calculate the angle between two vectors
Upvotes: -1