An extension class for Math.

Available since

0.1.0

.

See also:

Static methods

@:value({ inDeg : false })staticinlineangleFrom3Points(math:Class<Math>, p0:Point, p1:Point, p2:Point, inDeg:Bool = false):Float

Returns an angle from 3 points.

Parameters:

math

A Math class.

p0

A first point.

p1

A second point.

p2

A third point.

inDeg

true to return the value in degrees, false to return the value in radians.

Returns:

The angle between the ray (p0,p1) and the ray (p0,p2).

@:value({ inDeg : false })staticinlineangleFromPoints(math:Class<Math>, p1:Point, p2:Point, inDeg:Bool = false):Float

Returns an angle from 2 points.

For example, the result returned in degrees if p1 is at (0,0) and :
- p2 is at (1,0) is 0.
- p2 is at (0,1) is 90.
- p2 is at (-1,0) is 180.
- p2 is at (0,-1) is 270.

Parameters:

math

A Math class.

p1

A first point.

p2

A second point.

inDeg

true to return the value in degrees, false to return the value in radians.

Returns:

An angle.

staticgetFarthestPoints(math:Class<Math>, points:Array<Point>, direction:Point):Array<Point>

Returns the farthest points in a given direction.

Parameters:

math

A Math class.

points

An array of h2d.col.Point.

direction

Defines a direction where (1,0) is right and (0,1) is down.

Returns:

An array of h2d.col.Point. Only the points that are the farthest are returned, NOT all the points from the farthest to the closest.