Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shortest Distance to Ellipse from Point,

Status
Not open for further replies.

androsnich

Civil/Environmental
May 7, 2003
12
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,
Harry
 
Replies continue below

Recommended for you

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.
 
Gearguru,

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.

Thanks,
Brian

Brian Lewis
The Aerospace Corporation
 
Gearguru,

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 .

Thanks,
Harry
 
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,
bye

voya
 
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

Bye
 
"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.


 
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor