Distance from long lat line segment wrong over long distances [duplicate]
问题 This question already has answers here : Calculate possible lines from points (2 answers) Closed 5 years ago . I am calculating how far away a point is from a line segment on the earth. My function seemed to work, but as i've increased the distances it's clear it's not working. I presume this is due to the curvature of the earth. In my calculations Rome is shown as 5km from the line: London, UK - 0km Rome, Italy - 5km Cyrene, Libya - 0km But on Google Earth it's actually more like 61km When I