Shortest Distance to Ellipse from Point
Shortest Distance to Ellipse from Point
(OP)
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
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






RE: Shortest Distance to Ellipse from Point
Did that help?
RE: Shortest Distance to Ellipse from Point
Harry
RE: Shortest Distance to Ellipse from Point
If I've missed something then I suspect you need to look at the gradient of the two and make sure that one is (-1/the other gradient), but I'm pretty sure my first para covers your problem.
Cheers
Greg Locock
RE: Shortest Distance to Ellipse from Point
Why not set up an equation for the intersection between a circle, centre x1,y1, and your ellipse. Differentiate this to find the maxima and minima to find the minimum real value of r.
ax^2+by^2=1 (you did align the ellipse to the axes)
(x-x1)^2+(y-y1)^2=r^2
a,b,x1 and y1 are all known
Looks gnarly but doable. My electronic brain is elsewhere, sadly.
Cheers
Greg Locock
RE: Shortest Distance to Ellipse from Point
However the algebraic manipulations required are really too cumbersome.
If you want to give it a try, here's my starting point.
The equation of the normal to the point (x1,y1) on the ellipse is:
(x-x1)/b2x1=(y-y1)/a2y1
Your point (x0,y0) must lie on this line, then substituting it to (x,y) and solving for the unknown point (x1,y1) you should find:
(a2-b2)x1+b2y0x1/y1=a2x0
Rearranging to use the parametric form of ellipse's equation x1/a=cosθ and y1/b=sinθ and using the well known relationships
cosθ=(1-t2)/(1+t2) and tanθ=2t/(1-t2)
you should obtain something like:
(1-t2)2t(1-b2/a2)+(1-t2)(1+t2)2y0b/a2=2t(1+t2)x0/a
This is the quartic equation: good luck!
prex
http://www.xcalcs.com
Online tools for structural design
RE: Shortest Distance to Ellipse from Point
Does this solution have to be exact or can you work with a tolerance, say some percentage of the major axis ?. If so then it can done without solving a quartic every time or using any iterative methods.
RE: Shortest Distance to Ellipse from Point
As I have been thinking about solving quartics, I have considered the solution does not have to be exact. Some of the accuracy criteria I have thought of are:
1) The accuracy could be expressed as the point-ellipse distance +/- some absolute tollerance.
2) Or the accuracy could be expressed as the point-ellipseline's angle to the ellipse. This angle will be perpendicular at the exact sollution. An angle of +/- 0.5 degrees is ok.
Harry