org.openimaj.math.geometry.shape

## Class EllipseUtilities

• ```public class EllipseUtilities
extends Object```
An elliptical shape
Author:
Jonathon Hare (jsh2@ecs.soton.ac.uk)
• ### Constructor Summary

Constructors
Constructor and Description
`EllipseUtilities()`
• ### Method Summary

All Methods
Modifier and Type Method and Description
`static Ellipse` ```ellipseFromCovariance(float x, float y, Jama.Matrix sm, float sf)```
Construct ellipse from covariance matrix, scale-factor and centroid.
`static Ellipse` ```ellipseFromEquation(double centerX, double centerY, double major, double minor, double rotation)```
Construct an ellipse using a parametric ellipse equation, namely: X(t) = centerX + major * cos(t) * cos(rotation) - minor * sin(t) * sin(rotation) Y(t) = centerY + major * cos(t) * cos(rotation) + minor * sin(t) * sin(rotation)
`static Ellipse` ```ellipseFromGaussian(MultivariateGaussian gaussian, float scale)```
Construct an ellipse that encompasses the shape of a `CachingMultivariateGaussian`.
`static Ellipse` ```ellipseFromSecondMoments(float x, float y, Jama.Matrix secondMoments)```
Construct ellipse from second moment matrix and centroid.
`static Ellipse` ```ellipseFromSecondMoments(float x, float y, Jama.Matrix secondMoments, double scaleFactor)```
Construct ellipse from second moment matrix, scale-factor and centroid.
`static Jama.Matrix` `ellipseToCovariance(Ellipse e)`
Create the covariance matrix of an ellipse.
`static Ellipse` ```fromTransformMatrix2x2(Jama.Matrix U, float x, float y, float scale)```
Create an ellipse.
• ### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`
• ### Constructor Detail

• #### EllipseUtilities

`public EllipseUtilities()`
• ### Method Detail

• #### ellipseFromEquation

```public static Ellipse ellipseFromEquation(double centerX,
double centerY,
double major,
double minor,
double rotation)```
Construct an ellipse using a parametric ellipse equation, namely: X(t) = centerX + major * cos(t) * cos(rotation) - minor * sin(t) * sin(rotation) Y(t) = centerY + major * cos(t) * cos(rotation) + minor * sin(t) * sin(rotation)
Parameters:
`centerX` -
`centerY` -
`major` -
`minor` -
`rotation` -
Returns:
an ellipse
• #### ellipseFromSecondMoments

```public static Ellipse ellipseFromSecondMoments(float x,
float y,
Jama.Matrix secondMoments)```
Construct ellipse from second moment matrix and centroid.
Parameters:
`x` - x-ordinate of centroid
`y` - y-ordinate of centroid
`secondMoments` - second moments matrix
Returns:
an ellipse
• #### ellipseFromSecondMoments

```public static Ellipse ellipseFromSecondMoments(float x,
float y,
Jama.Matrix secondMoments,
double scaleFactor)```
Construct ellipse from second moment matrix, scale-factor and centroid.
Parameters:
`x` - x-ordinate of centroid
`y` - y-ordinate of centroid
`secondMoments` - second moments matrix
`scaleFactor` - the scale factor
Returns:
an ellipse
• #### ellipseFromCovariance

```public static Ellipse ellipseFromCovariance(float x,
float y,
Jama.Matrix sm,
float sf)```
Construct ellipse from covariance matrix, scale-factor and centroid.
Parameters:
`x` - x-ordinate of centroid
`y` - y-ordinate of centroid
`sm` - covariance matrix
`sf` - scale-factor
Returns:
an ellipse
• #### ellipseToCovariance

`public static Jama.Matrix ellipseToCovariance(Ellipse e)`
Create the covariance matrix of an ellipse.
Parameters:
`e` - the ellipse
Returns:
the corresponding covariance matrix
• #### fromTransformMatrix2x2

```public static Ellipse fromTransformMatrix2x2(Jama.Matrix U,
float x,
float y,
float scale)```
Create an ellipse.
Parameters:
`U` -
`x` -
`y` -
`scale` -
Returns:
an ellipse