Geometric functions
Namespaces
Methods
(static) angleOfTwoPtLine(startPt, endPt, mode)
Returns angle of a two-point line.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
startPt |
Array.<number> | x and y coordinate | |
endPt |
Array.<number> | x and y coordinate | |
mode |
string | rad | 'rad' (default) or 'deg'F |
Returns:
angle of a two-point line.
(static) getSquarePtsInArea(x, y, distance, centrePoints)
Gets square points in area
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
x |
number | maximum X bound | |
y |
number | maximum Y bound | |
distance |
number | distance between points | |
centrePoints |
boolean | true | if true, points will be centred on origin. If false, origin will be at a corner. |
Returns:
set of x and y coordinates for points
(static) getTriangularPtsInArea(x, y, distance, centrePoints)
Gets triangular points in area
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
x |
number | maximum X bound | |
y |
number | maximum Y bound | |
distance |
number | distance between points | |
centrePoints |
boolean | true | if true, points will be centred on origin. If false, origin will be at a corner. |
Returns:
set of x and y coordinates for points
(static) pointFromAngleAndDist(angleRad, dist)
Gets a point from a given angle and distance, starting from [0, 0]
Parameters:
| Name | Type | Description |
|---|---|---|
angleRad |
number | angle (radians) |
dist |
number | distance |
Returns:
x and y coord of calculated point