Given two GPS lat/lon/altitude coordinates of two aircraft, how do I compute the slant range (line of sight distance) between them?
-
Have a look at my answer to this question, it uses the ellipsoidal formulae, and you can use them to calculate a straight line distance. – FSimardGIS Feb 27 '19 at 23:31
1 Answers
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:
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.
- 262
-
Thanks for the feedback! In your approximate method, what is "Lat" in your calculation of "x"? – CrashLandon Feb 27 '19 at 19:02
-
"Lat" is the latitude of the point that is being projected, But if the difference in two points are being calculated then it is the chosen latitude of the two points or possibly the average latitude of the two points. – S Spring Feb 27 '19 at 20:56
-
But the Local Topocentric calculation might be correct for the subject. Local Topocentric is a radar scope where point1 is the pole point and point2 is the point set relevant to the pole point. Or for a field of points relevant to each other in any manner that is a similar Orthographic projection. An Orthographic projection is accurate to about 90 km from center but the most accurate result is a calculation from the actual pole point. – S Spring Feb 28 '19 at 02:06