Static class provides methods to work with lines in a cartesian coordinates
Methods
(static) checkLinesIntersection(lS1, lS2) → {Boolean}
Checks if two lines segments are intersected
Parameters:
Name | Type | Description |
---|---|---|
lS1 |
LineSegment | |
lS2 |
LineSegment |
Returns:
- Type
- Boolean
(static) distanceBtwTwoPoints(point1, point2) → {Number}
Counts distance between two points
Parameters:
Name | Type | Description |
---|---|---|
point1 |
Point | First point |
point2 |
Point | First point |
Returns:
- Type
- Number
(static) findPolygonInsertIndex(polygonPoints, point) → {Number}
Finds an index in the polygon points array between 2 nearest points
to the passed coordinates
Parameters:
Name | Type | Description |
---|---|---|
polygonPoints |
Array | |
point |
Point | New vertex coordinates |
Returns:
- Type
- Number
(static) generateLineSegments(points) → {Array.<LineSegment>}
Generates line segments array based on passed coordinates
Parameters:
Name | Type | Description |
---|---|---|
points |
Array.<Number> | polygon vertexes coordinates |
Returns:
- Type
- Array.<LineSegment>
(static) lineSegmentMidPoint(lineSegment) → {Array}
Finds line segment middle point
Parameters:
Name | Type | Description |
---|---|---|
lineSegment |
LineSegment |
Returns:
Point
- Type
- Array