computeLineSegmentLineSegmentIntersection

fun computeLineSegmentLineSegmentIntersection(x00: Double, y00: Double, x01: Double, y01: Double, x10: Double, y10: Double, x11: Double, y11: Double, result: Cartesian2? = definedExternally): Cartesian2(source)

Compute the intersection between 2 line segments

const result = Intersections2D.computeLineSegmentLineSegmentIntersection(0.0, 0.0, 0.0, 2.0, -1, 1, 1, 1);
// result === new Cartesian2(0.0, 1.0);

Return

The intersection point, undefined if there is no intersection point or lines are coincident.

Parameters

x00

The x coordinate of the first line's first vertex.

y00

The y coordinate of the first line's first vertex.

x01

The x coordinate of the first line's second vertex.

y01

The y coordinate of the first line's second vertex.

x10

The x coordinate of the second line's first vertex.

y10

The y coordinate of the second line's first vertex.

x11

The x coordinate of the second line's second vertex.

y11

The y coordinate of the second line's second vertex.

result

The instance into to which to copy the result. If this parameter is undefined, a new instance is created and returned.

See also