I have to find out if the point is on the ellipse? Would you please help me how to do this? I need a function.
Printable View
I have to find out if the point is on the ellipse? Would you please help me how to do this? I need a function.
Then general equation for an ellipse in cartesion coordinates is:
(x-h)^2/a^2 + (y-k)^2/b^2 = 1
where,
(h,k) are the coordinates of the center of the ellipse
a is the length of the semi-major or minor axis
b is the length of the semi-major or minor axis
Whether a or b is the semi-major axis depends on which value, a or b, is greater but I think if you're asking the question then you understand this.
For the picture that you attached, the center of the ellipse, (h,k), is (20,10). The semi-major axis, a, equals 20, and the semi-minor axis, b, equals 10.
Anyway, in order to determine if a given point, (P,Q) lies on the ellipse you need only compute the left side of the equation above substituting all the values above and putting P in place of X and Q in place of Y and see if it equals 1. If it does, then the point lies on the ellipse, otherwise it doesn't.
If you're going to use a computer to do the number crunching, you'll need to figure out is "close enough" to be considered on the ellipse.
Hope that helps.
Thank you very much , Wy125