@technobuddha > library > Geometry
Line Segment
| Name | Type | Description |
|---|---|---|
| lineIntersection | Function | Calculates the intersection point of two line segments. |
| lineLength | Function | Calculates the length of a line segment. |
| LineSegment | Type | Represents a line segment in 2D space, defined by its start and end points. |
| midpoint | Function | Calculates a point at a given fraction (part) along a line segment. By default it returns the true midpoint of the line segment |
| normalizeLineSegment | Function | Returns a LineSegment where the point with the higher y-coordinate is always the starting point (x0, y0). If the original line's y1 is greater than y0, the line is returned as-is. Otherwise, the start and end points are swapped. |
| OnLineOptions | Type | Options for the isOnLine function |
| polygonSides | Function | Generate line segments for each side of the polygon. |
| toLineSegment | Function | Converts two Cartesian points into a LineSegment object. |