Point to great-circle segment distance

Viewed 2206

I want to calculate the distance from a point given by latitude and longitude to a line-segment given by two points (part of a great-circle). All coordinates are given in WGS84.

enter image description here

I know how to calculate this in Cartesian coordinates but not on a sphere. Can somebody please provide the formula?

2 Answers
Related