Methods
(static) convertLines(points) → {number[][][]}
Convert two points into lines.
Name | Type | Description |
---|---|---|
points |
number[][] |
Returns:
- Type
- number[][][]
(static) fitPoints(points, rect) → {number[][]}
Get points that fit the rect,
Name | Type | Description |
---|---|---|
points |
number[][] | |
rect |
Rect |
Returns:
- Type
- number[][]
(static) getAreaSize(points) → {number}
Gets the size of a shape (polygon) made of points.
Name | Type | Description |
---|---|---|
points |
number[][] |
Returns:
- Type
- number
(static) getDistanceFromPointToConstants(pos)
Get distance from point to constants. [a, b, c] (ax + by + c = 0)
Name | Type | Description |
---|---|---|
|
[number, number, number] | |
pos |
number[] |
Returns:
[a, b, c]
(static) getIntersectionPoints(line1, line2, isLimitopt) → {number[][]}
Get intersection points to the two lines.
Name | Type | Description |
---|---|---|
line1 |
number[][] | |
line2 |
number[][] | |
isLimit ? |
boolean |
Returns:
- Type
- number[][]
(static) getIntersectionPointsByConstants(linearConstants1, linearConstants2) → {number[][]}
Get intersection points with linear functions.
Name | Type | Description |
---|---|---|
linearConstants1 |
number[] | |
linearConstants2 |
number[] |
Returns:
- Type
- number[][]
(static) getLinearConstants(point1, point2) → {[number, number, number]}
Get the coefficient of the linear function. [a, b, c] (ax + by + c = 0)
Name | Type | Description |
---|---|---|
point1 |
number[] | |
point2 |
number[] |
Returns:
[a, b, c]
- Type
- [number, number, number]
(static) getMinMaxs(points) → {{minX: number, minY: number, maxX: number, maxY: number}}
Get the minimum and maximum points of the points.
Name | Type | Description |
---|---|---|
points |
number[][] |
Returns:
- Type
- {minX: number, minY: number, maxX: number, maxY: number}
(static) getOverlapAreas(points1, points2) → {number[][][]}
Get the areas of the overlapped part of two shapes.
Name | Type | Description |
---|---|---|
points1 |
number[][] | |
points2 |
number[][] |
Returns:
- Type
- number[][][]
(static) getOverlapPoints(points1, points2) → {number[][]}
Get the points of the overlapped part of two shapes.
Name | Type | Description |
---|---|---|
points1 |
number[][] | |
points2 |
number[][] |
Returns:
- Type
- number[][]
(static) getOverlapSize(points1, points2) → {number}
Gets the size of the overlapped part of two shapes.
Name | Type | Description |
---|---|---|
points1 |
number[][] | |
points2 |
number[][] |
Returns:
- Type
- number
(static) getPointsOnLines(points, lines) → {number[][]}
Get the points on the lines (between two points).
Name | Type | Description |
---|---|---|
points |
number[][] | |
lines |
number[][][] |
Returns:
- Type
- number[][]
(static) getUnoverlapAreas(points1, points2) → {number[][][]}
Get non-overlapping areas of two shapes based on points1.
Name | Type | Description |
---|---|---|
points1 |
number[][] | |
points2 |
number[][] |
Returns:
- Type
- number[][][]
(static) isInside(pos, points, excludeLineopt) → {boolean}
Whether the point is in shape
Name | Type | Description |
---|---|---|
pos |
number[] | point pos |
points |
number[][] | shape points |
excludeLine ? |
boolean | whether to check except line |
Returns:
- Type
- boolean