Method IntersectLineSegments
IntersectLineSegments(Vector2, Vector2, Vector2, Vector2)
Finds the intersection between two line segments
Declaration
public static Vector2 IntersectLineSegments(Vector2 line1Pt1, Vector2 line1Pt2, Vector2 line2Pt1, Vector2 line2Pt2)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | line1Pt1 | The first point of the first line |
Vector2 | line1Pt2 | The second point of the first line |
Vector2 | line2Pt1 | The first point of the second line |
Vector2 | line2Pt2 | The second point of the second line |
Returns
Type | Description |
---|---|
Vector2 | The intersection point, or (float.PositiveInfinity, float.PositiveInfinity) if the lines are parallel |