colour.algebra.ellipse_coefficients_canonical_form

colour.algebra.ellipse_coefficients_canonical_form(coefficients)[source]

Returns the canonical form ellipse coefficients from given general form ellipse coefficients.

The general form ellipse coefficients are the coefficients of the implicit second-order polynomial/quadratic curve expressed as follows:

\(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

coefficients (array_like) – General form ellipse coefficients.

Returns

Canonical form ellipse coefficients.

Return type

ndarray

References

[Wikipedia]

Examples

>>> coefficients = np.array([ 2.5, -3.0,  2.5, -1.0, -1.0, -3.5])
>>> ellipse_coefficients_canonical_form(coefficients)
array([  0.5,   0.5,   2. ,   1. ,  45. ])