I found a similiar question that also asks for the distance from a point to a line but works on a sphere.

Now I'm trying to figure out the length of the geodesic line d between the given geodesic AB and the point C.

Is this the same problem as in the given question? Am I overthinking this?

For illustration


  • $\begingroup$ It's definitely not as simple as for a sphere. Just computing the distance between two points seems quite complicated: en.wikipedia.org/wiki/Vincenty%27s_formulae $\endgroup$ May 25, 2012 at 8:12
  • $\begingroup$ Vincenty is one of many ways to compute the distance of two points on an ellipsoid. And, yes it looks rather scary but is easily implemented in code. $\endgroup$
    – oschrenk
    May 25, 2012 at 10:47

3 Answers 3


Code to implement the solution of this problem using GeographicLib is available as message #4 in this the help thread.

The solution is also discussed in Section 8 of my paper "Algorithms for geodesics" which appeared recently in the Journal of Geodesy. You can download this from here.

This is an "open access" article, so you don't need a journal subscription to download it.


It seems that the math behind this is more complicated than I thought it would be (please correct me if I'm wrong).

I found a very good paper by Charles F. F. Karney called Geodesics on an ellipsoid of revolution which not only explains the forward and inverse geodetic problem but also explores other problems on ellipsoids such as finding the shortest distance from between a point and a line (geodesic between two points) on an oblate spheroid.

The abstract of the paper:

Algorithms for the computation of the forward and inverse geodesic problems for an ellipsoid of revolution are derived. These are accurate to better than 15 nm when applied to the terrestrial ellipsoids. The solutions of other problems involving geodesics (triangulation, projections, maritime boundaries, and polygonal areas) are investigated.

He also implemented code in c and javascript and I took the liberty of starting to port it to Java as a project called geographiclib-j


There are probably a lot of ways to do this.

Note that the parametric equation of the sphere is very similar to the parametric equation of an spheroid. If you can calculate the geodesic of a sphere from its parametric representation, you might be able to apply the same procedure to the spheroid.


You could also use the tools of tensor calculus by calculating the Transformation Matrix from Spherical To Oblate Coordinates $[\frac{dx^a}{d\bar{x}^u}]$, and then calculate the oblate metric using $\bar{g}_{uv}=\frac{dx^a}{d\bar{x^u}} \frac{dx^b}{d\bar{x}^u}g_{ab}$ then apply the geodesic equation to the metric of Oblate Coordinates and solve it.

I believe it is also possible to calculate the geodesic in Spherical Coordinates and transform your answer to Oblate Coordinates because the solution will be a vector equation. This would obviously be much easier.

Because parametric representations are very similar, the transformation matrices are easy to calculate.

There is also this direct method: http://mathworld.wolfram.com/OblateSpheroidGeodesic.html

  • 2
    $\begingroup$ Because distance scales non-uniformly between spherical and oblate coordinates, I'm pretty certain that you can't simply calculate a spherical geodesic and scale down. For instance, the very similar problem of finding the closest point on a plane to a given point isn't invariant under scaling transformations. $\endgroup$ Jun 21, 2012 at 21:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .