I have a line defined by two points, p1 and p2.
I also have an ellipse defined by a center point c and a radius in the x-dimension a and a radius in the y-dimension b. The ellipse is aligned with the coordinate axes.
I would like to know the point (if any) where the line intersects the ellipse.
Can someone give me the formula?
Express the equation of
the line in the form y = m*x + d...(1)
and the equation of the ellipse in the form
(x-xc)^2/a^2 + (y-yc)^2/b^2 = 1...(2)
Substitute y from (1) into (2) and solve for the two values of x-coord.
Then from (1) get x = (y-d)/m , substitute this into
(2) and solve for the two y-coord values.
Both these equations will have sqrt terms, as you are solving quadratics.
If the value under the sqrt is zero, then both values are equal, and the line is tangent to the ellipse.
If the value under the sqrt is negative, then there are no real solutions as the line does not intersect the ellipse.
Regards, Peter Scales.
Thank you very much for answering this. I was also given a similar problem and your explanation helped me a lot in understanding this.
Thanks, Kunio
--
[url=http://revitolstretchmarkcreaminfo.org]Revitol Stretch Mark Prevention[/url]