Distance between two gps coordinates. Solve for r and θ assuming j,b,t,w are known.

longlostbro

New member
Joined
Jun 29, 2018
Messages
1
Distance between two gps coordinates. Solve for r and θ assuming j,b,t,w are known.

This is an equation for calculating the distance in meters between two gps locations.

EarthRadius = 6378137.0
DegreesToRadians = 0.0174532925
RadiansToDegrees = 57.2957795
r is the distance in meters
θ is the bearing
j is starting latitude
k is starting longitude
t is ending latitude
w is ending longitude

Solve for r and θ assuming j,b,t,w are known

a=j*0.0174532925
b=k*0.0174532925
x=r/6378137.0
y=θ*0.0174532925
z=arcsin(sin(a)*cos(x)+cos(a)*sin(x)*cos(y))
d=arctanh(sin(y)*sin(x)*cos(a),cos(x)-sin(a)*sin(z))
m=((b+d+pi)%(pi*2))-pi
t=z*57.2957795,w=m*57.2957795
 
This is an equation for calculating the distance in meters between two gps locations.

EarthRadius = 6378137.0
DegreesToRadians = 0.0174532925
RadiansToDegrees = 57.2957795
r is the distance in meters
θ is the bearing
j is starting latitude
k is starting longitude
t is ending latitude
w is ending longitude

Solve for r and θ assuming j,b,t,w are known

a=j*0.0174532925
b=k*0.0174532925
x=r/6378137.0
y=θ*0.0174532925
z=arcsin(sin(a)*cos(x)+cos(a)*sin(x)*cos(y))
d=arctanh(sin(y)*sin(x)*cos(a),cos(x)-sin(a)*sin(z))
m=((b+d+pi)%(pi*2))-pi
t=z*57.2957795,w=m*57.2957795

1) "Bearing" is a tricky term. Great circle route?
2) Absence of Altitude it problematic.
3) Distance between latitudes is not constant. Greatest at the Equator. Zero at the Poles.
 
Top