class MathExt
package nb.ext
Static methods
staticinlineangleFrom3Points(math:Class<Math>, p0:Point, p1:Point, p2:Point, inDeg:Bool = false):Float
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 |
---|---|
p1 | A first point. |
p2 | A second point. |
inDeg |
|
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 |
---|---|
points | An array of |
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.