Calculate slant range between two GPS coordinates, including altitude

3.2k Views Asked by At

Given two GPS lat/lon/altitude coordinates of two aircraft, how do I compute the slant range (line of sight distance) between them?

1

There are 1 best solutions below

3
On

Convert the latitude, longitude, and altitude to x,y,z coordinates:

https://gssc.esa.int/navipedia/index.php/Ellipsoidal_and_Cartesian_Coordinates_Conversion

However, there is the issue of ellipsoid height versus orthometric height:

https://www.researchgate.net/figure/Relationship-between-orthometric-height-ellipsoid-height-and-geoid-height_fig1_273133676

Next, convert the x,y,z coordinates to u,v,w:

http://hydrometronics.com/downloads/Ellipsoidal%20Orthographic%20Projection.pdf

However, the pole point of the first point must be held for additional points in the same field. For instance, as the orthographic projection instead of one vector between two points.

Then distance = Square Root of (u'^2 + v'^2 + w'^2) with u' = u2 - u1, v' = v2 - v1, and w' = w2 - w1 .


Or here is an approximate method using degrees and meters:

y = (Lat2 - Lat1) * 60 * 1852

x = (Lon2 - Lon1) * Cos(Lat) * 60 * 1852

z = Altitude2 - Altitude1

Then distance = Square Root of (x^2 + y^2 + z^2) .

Also, the x and y of each point can be calculated separately. Just first net a constant with the longitudes so that they straddle zero longitude.

Instead of using 1852 meters for 1 minute of latitude try Tan(1/60) * (6366707 + altitude-in-meters). Also, use a more accurate radius-of-earth if known at the particular latitude.