Calculate an ellipse from 3-4 points that is parallel to the X and Y axes

76 Views Asked by At

I'm working on a simple graphics tool that currently draws an ellipse using a bounding rectangle. This is nice and simple, as you just drag the two corners of the rectangle to where you want it.

I have been requested to generate an ellipse using 3-4 points that exist along the ellipse perimeter. This way you can plot 3 or 4 points along the edge of a pre-existing ellipse and have the tool match it.

The constraints are that the ellipse major & minor axes are parallel to the X and Y axes, no rotation. Is this possible?

From what I can understand so far is that from only 3 points, I can only reliably create a circle, but would 4 points be enough to calculate the Major Axis, Minor Axis, and Center of an ellipse?

Update: Clarification
None of the points are expected to reside on either Major or Minor axis, and the center is expected to never be zero.

Update 2: Must have 4 points
Based on the discussion here: How many points are needed to uniquely define an ellipse?, 4 points will define an infinite number of ellipses. So it looks like I would need to have a minimum of 5 points.