Point to great-circle segment distance (WGS84)

809 Views Asked by At

Disclaimer: This is a cross-post from stackoverflow -- the community recommended to post it here again


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.

point-great-circle-arc-distance

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

1

There are 1 best solutions below

0
On

I refer to the figure provided by OP and call the given base point the red point and the segment marked blue on the great circle the blue target (curved) segment.

Based on comments I suppose OP approves the assumption of spherical shape of the earth. Therefore, the radius $R$ of the earth is taken to be constant everywhere.

It makes the problem easy to know that the two ends of the blue target (curved) segment are on the same meridian. This means that the sought perpendicular is a segment on the latitudinal circle that passes through the red point. Specifically, we are looking for the length of a (curved) segment on the latitudinal circle of the red point, bounded between the longitudes of the red point and the blue target (curved) segment.

The radius of the said longitudinal circle is $$r = R cos {\beta} $$ where $\beta$ is the red point's latitude.

The length of the sought perpendicular is then $$s = r(\Delta \alpha) $$ where $\Delta \alpha$ is the difference between longitudes of the red point and the blue target (curved) segment.