Circle

Circle shape.

Constructor

new Circle(centre, radius)

Parameters:
NameTypeDescription
centrePoint2D

A Point2D representing the centre of the circle.

radiusnumber

The radius of the circle.

Classes

Circle

Methods

equals(rhs) → {boolean}

Check for equality.

Parameters:
NameTypeDescription
rhsCircle

The object to compare to.

Returns:

True if both objects are equal.

Type: 
boolean

getCenter() → {Point2D}

Get the centre (point) of the circle.

Returns:

The center (point) of the circle.

Type: 
Point2D

getRadius() → {number}

Get the radius of the circle.

Returns:

The radius of the circle.

Type: 
number

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

Get the rounded limits of the circle.

See: https://en.wikipedia.org/wiki/Circle#Equations.

Circle formula: x*x + y*y = r*r.

Implies: y = (+-) sqrt(r*r - 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 circle.

Returns:

The surface of the circle.

Type: 
number

getWorldSurface(spacing2D) → {number}

Get the surface of the circle according to a spacing.

Parameters:
NameTypeDescription
spacing2DScalar2D

The 2D spacing.

Returns:

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

Type: 
number

quantify(viewController, flags) → {object}

Quantify an circle 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