Click or drag to resize

LineToolsLineIntersect Method (Vector2, Vector2, Vector2, Vector2, Vector2)

This method detects if two line segments intersect, and, if so, the point of intersection. Note: If two line segments are coincident, then no intersection is detected (there are actually infinite intersection points).

Namespace:  Internal.tainicom.Aether.Physics2D.Common
Assembly:  NeoAxis.Core (in NeoAxis.Core.dll) Version: 2024.1.1.0 (2024.1.1.0)
Syntax
C#
public static bool LineIntersect(
	Vector2 point1,
	Vector2 point2,
	Vector2 point3,
	Vector2 point4,
	out Vector2 intersectionPoint
)

Parameters

point1
Type: Internal.tainicom.Aether.Physics2D.CommonVector2
The first point of the first line segment.
point2
Type: Internal.tainicom.Aether.Physics2D.CommonVector2
The second point of the first line segment.
point3
Type: Internal.tainicom.Aether.Physics2D.CommonVector2
The first point of the second line segment.
point4
Type: Internal.tainicom.Aether.Physics2D.CommonVector2
The second point of the second line segment.
intersectionPoint
Type: Internal.tainicom.Aether.Physics2D.CommonVector2
This is set to the intersection point if an intersection is detected.

Return Value

Type: Boolean
True if an intersection is detected, false otherwise.
See Also