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