Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


Shortest Distance to Ellipse from Point,

Shortest Distance to Ellipse from Point,

Shortest Distance to Ellipse from Point,

Shortest Distance to Ellipse from Point,
Or: What is the Line Perpendicular to the Ellipse?

What is a good method to determine the shortest distance from a point to an Ellipse? This is similar to finding the line through a given point that is perpendicular to an ellipse.

To make it simple, I have the ellipse centered at the origin, (0,0), and the major axis along x. Also the point is always in quadrant I, and is always outside the ellipse.

Thanks for your help,

RE: Shortest Distance to Ellipse from Point,

I know it is late, but perhaps this will help somebody anyway.
I tried to calculate the distance by creating the equation for the distance between two points, where one point (outside of the ellipse) has known and constant x,y and the second one has coordinates taken from the equation of the ellipse. Then I calculated first derivative of that equation - and get lost, because the formula was too complicated (I wanted to set it = zero to get the minimum of that function and calculate the coordinate).
I mentioned the problem to my friend, a VERY good mathematician and he solved it (slightly different way).
His solution is rather long to show it here, but I have Word *.doc file with full description, which I can share with anybody who posts his e-mail here.

RE: Shortest Distance to Ellipse from Point,


I tried doing the same technique you did and got bogged down trying to solve three equations with four unknowns.  I wasn't sure if I had done the math incorrectly, or if I needed to try to find another equation to use, but I would be interested in seeing your friends analysis.  I'm at Brian.S.Lewis(at)aero.org if you don't mind sending it.


Brian Lewis
The Aerospace Corporation

RE: Shortest Distance to Ellipse from Point,


I too have bogged down trying to solve the fourth order polynomial equations.  I would be interested in seeing your friends analysis.  I'm at american_flyer(at)juno.com .


RE: Shortest Distance to Ellipse from Point,

See Dave Eberly's www.magic-software.com site for questions like this.

RE: Shortest Distance to Ellipse from Point,

hi, there!

maybe it's late, as someone said before me, but, somebody can find my (possible) solution useful. it's a geometrical one - if you have a point A whose shortest distance from an ellipse you want to find, being inside or outside of the ellipse area, you can draw a circle with the centre in that point with the radio slightly bigger of the expected shortest distance. the two points of intersection, let's call them B anc C, between the circle and the ellipse are the first and end point of a line. then, you draw a line from the point A to the middle point of the line BC which intersects the ellipse in the point D. the distance AD can be considered the shortest one. there are just two things: 1. the smallest the lenght BC is the more accurate is the solution; 2. the points B and C should be searched by some method already developed (like those found on magic-software.com)

i hope you find it correct and useful,


RE: Shortest Distance to Ellipse from Point,

Hi, once again! i continued working on the subject and i have another, this time mathematical, solution of this problem. what you have to do is express the ellipse in a parametric way. If:

    x^2/a^2 + y^2/b^2 = 1, then the parametric form is:

    x=asinU;  y=bcosU ==>  dx/dU=acosU; dy/dU=-bsinU

Then, the distance can be expressed as:

    s^2 = (x-xp)^2 + (y-yp)^2

In order to have the shortest distance s, it is necessary to fulfil the condition:

    ds/dU = 0

so:   2s*ds/dU = 0 = (x-xp)dx/dU + (y-yp)dy/dU

Substituting x, dx/dU, y, dy/dU we obtain an equation that is arranged and finally transformed to an equation of following form:

     At^4 + Bt^3 + Ct^2 + Dt + E = 0 (t=sinU)

which leeds us to fur solutions of which only one corresponds to the real one. Then, it's easy to search:

     t -> U -> x,y -> s


RE: Shortest Distance to Ellipse from Point,

"2s*ds/dU = 0 = (x-xp)dx/dU + (y-yp)dy/dU" should be
"s*ds/dU = 0 = (x-xp)dx/dU + (y-yp)dy/dU" (You missed out the 2's when differentiating the RHS). But just like everyone else, you end up having to solve a quartric, either numerically or closed form - which is essentially all that the problem amounts to.

RE: Shortest Distance to Ellipse from Point,

By the way, many have obviously trodden these paths before. See for example the following :
Unfortunately, this "Dr. Rob" from Drexel seems to be just as chicken as the rest of us, although I don't know why he would say there may  be a general formula. On the contrary, there must  be a general formula, (ie a "closed form" solution), since there is a standard procedure for solving a quartic and it is just a matter of slogging through it. See for example the following :


Or even this from Dr. Rob himself (!) :

Of course, it may be that "Dr. Rob" is actually several different people, and "the left hand doesn't know what the right hand is doing".

Why an engineer in this computer era would actually need to do this - except of course for the fun of it - is beyond me . A numerical solution to any desired degree of precision is straightforward.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close