Calculate Ellipse From Points?

$\begingroup$

How can I calculate an ellipse from a group of points ?

enter image description here

Result: center point, x-radius, y-radius ?

I'm not mathematician so I don't really know the best parameter style for ellipses. This ellipse is aligned to X and Y axes and I usually go with center point and 2 radii in x and y directions.

$\endgroup$ 3

1 Answer

$\begingroup$

Finding parameters

An ellipse (and in fact any conic section) is described by an equation of the form

$$ax^2+by^2+cxy+dx+ey+f=0$$

Any multiple of this equation describes the same ellipse. The parameters $a$ through $f$ can be found up to that multiple by knowing $5$ points on the ellipse:

$$\begin{pmatrix} x_1^2 & y_1^2 & x_1y_1 & x_1 & y_1 & 1 \\ x_2^2 & y_2^2 & x_2y_2 & x_2 & y_2 & 1 \\ x_3^2 & y_3^2 & x_3y_3 & x_3 & y_3 & 1 \\ x_4^2 & y_4^2 & x_4y_4 & x_4 & y_4 & 1 \\ x_5^2 & y_5^2 & x_5y_5 & x_5 & y_5 & 1 \\ \end{pmatrix} \cdot \begin{pmatrix} a \\ b \\ c \\ d \\ e \\ f \end{pmatrix} =\begin{pmatrix} 0 \\ 0 \\ 0 \\ 0 \\ 0 \end{pmatrix} $$

If you have more than five data points, you may choose any five of them. If your data points are not perfectly accurate, then look into Ellipse fitting methods.

Changing the representation

To turn the parameters you found into center, radii and orientation you can follow the steps which I outlined in this answer.

$\endgroup$ 1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like