Search code examples
algorithmgpsgeometrylatitude-longitudeintersection

Distance from point to line on Earth


I need something as simple as

"Subject 1.02: How do I find the distance from a point to a line?"

But that works with Lon/Lat.


Solution

  • thank you trying to teach me, but I have asked for a simple pragmatic solution. Not a math lecture.

    Anyway, here is a simple answer:

    Look here: http://www.movable-type.co.uk/scripts/latlong.html

    Calculate "Bearing" (from start of the line to point distance from each I want to know) + "Cross-talk distance".

    That is it. We are done in a couple of lines of code. No iterations. No additional libs. Lean and mean.