Ellipse

Ellipse shape.

Constructor

new Ellipse(centre, a, b)

Parameters:
NameTypeDescription
centrePoint2D

A Point2D representing the centre of the ellipse.

anumber

The radius of the ellipse on the horizontal axe.

bnumber

The radius of the ellipse on the vertical axe.

Classes

Ellipse

Methods

equals(rhs) → {boolean}

Check for equality.

Parameters:
NameTypeDescription
rhsEllipse

The object to compare to.

Returns:

True if both objects are equal.

Type: 
boolean

getA() → {number}

Get the radius of the ellipse on the horizontal axe.

Returns:

The radius of the ellipse on the horizontal axe.

Type: 
number

getB() → {number}

Get the radius of the ellipse on the vertical axe.

Returns:

The radius of the ellipse on the vertical axe.

Type: 
number

getCenter() → {Point2D}

Get the centre (point) of the ellipse.

Returns:

The center (point) of the ellipse.

Type: 
Point2D

getRound() → {Array.<Array.<Array.<number>>>}

Get the rounded limits of the ellipse.

See: https://en.wikipedia.org/wiki/Ellipse#Standard_equation.

Ellipse formula: x*x / a*a + y*y / b*b = 1.

Implies: y = (+-)(b/a) * sqrt(a*a - x*x).

Returns:

The rounded limits: list of [x, y] pairs (min, max).

Type: 
Array.<Array.<Array.<number>>>

getSurface() → {number}

Get the surface of the ellipse.

Returns:

The surface of the ellipse.

Type: 
number

getWorldSurface(spacing2D) → {number}

Get the surface of the ellipse according to a spacing.

Parameters:
NameTypeDescription
spacing2DScalar2D

The 2D spacing.

Returns:

The surface of the ellipse multiplied by the given spacing or null for null spacings.

Type: 
number

quantify(viewController, flags) → {object}

Quantify an ellipse according to view information.

Parameters:
NameTypeDescription
viewControllerViewController

The associated view controller.

flagsArray.<string>

A list of stat values to calculate.

Returns:

A quantification object.

Type: 
object