I have a line segment AB made up of two LatLngs, A and B.

I have another LatLng C and a bearing x degrees.

How can I calculate the point D where a line from C with bearing x degrees meets the line segment AB, if at all it meets?

All the lines and line segments are geodesic and are not straight. Pictorial representation

  • 2
    Can you add some picture for great understanding ? Sep 25, 2017 at 18:43
  • Spherical geometry or ellipsoidal?
    – Spacedman
    Apr 30, 2019 at 14:10

1 Answer 1


Pick a point D on the geodesic starting at C. Find the intersection of AB and CD using the method given in Section 8 of my paper Algorithms for geodesics. Finally, determine whether the intersection point lies within the segment AB and on the right side of C. Code to find the intersection is given in intersect.cpp.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.