Skip to main content
edited tags
Link
whuber
  • 70.2k
  • 16
  • 187
  • 282
Source Link
Pris
  • 1.3k
  • 4
  • 14
  • 23

Finding the minimum and maximum distance between an observer and a lat/lon bounding box

I have three points in geographic coordinates (latitude, longitude, altitude). One of the points represents an observer, above the Earth. The other two points define a bounding box. I'd like a somewhat efficient way to determine the minimum and maximum straight-line distance between the observer and the edges of the bounding box. I'm concerned with performance over accuracy, so I'm okay with using the spherical model of the Earth for speed gains. Please see the image for a stunning rendition of the aforementioned scenario.

pic