# colour.algebra.ellipse_fitting_Halir1998¶

colour.algebra.ellipse_fitting_Halir1998(a)[source]

Returns the coefficients of the implicit second-order polynomial/quadratic curve that fits given point array $$a$$ using Halir and Flusser (1998) method.

The implicit second-order polynomial is expressed as follows:

:math:F\left(x, y\right) = ax^2 + bxy + cy^2 + dx + ey + f = 0


with an ellipse-specific constraint such as $$b^2 -4ac < 0$$ and where $$a, b, c, d, e, f$$ are coefficients of the ellipse and $$F\left(x, y\right)$$ are coordinates of points lying on it.

Parameters

a (array_like) – Point array $$a$$ to be fitted.

Returns

Coefficients of the implicit second-order polynomial/quadratic curve that fits given point array $$a$$.

Return type

ndarray

References

[HF98]

Examples

>>> a = np.array([[2, 0], [0, 1], [-2, 0], [0, -1]])
>>> ellipse_fitting_Halir1998(a)
array([ 0.2425356...,  0.        ,  0.9701425...,  0.        ,  0.        ,
-0.9701425...])
>>> ellipse_coefficients_canonical_form(ellipse_fitting_Halir1998(a))
array([-0., -0.,  2.,  1.,  0.])
`