Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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


share|cite|improve this question
It's definitely not as simple as for a sphere. Just computing the distance between two points seems quite complicated: – Hans Lundmark May 25 '12 at 8:12
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. – oschrenk May 25 '12 at 10:47

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

share|cite|improve this answer

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.

share|cite|improve this answer

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:

share|cite|improve this answer
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. – Steven Stadnicki Jun 21 '12 at 21:37

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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