lineSegmentPlane

fun lineSegmentPlane(endPoint0: Cartesian3, endPoint1: Cartesian3, plane: Plane, result: Cartesian3? = definedExternally): Cartesian3(source)

Computes the intersection of a line segment and a plane.

const origin = Cartesian3.fromDegrees(-75.59777, 40.03883);
const normal = ellipsoid.geodeticSurfaceNormal(origin);
const plane = Plane.fromPointNormal(origin, normal);

const p0 = new Cartesian3(...);
const p1 = new Cartesian3(...);

// find the intersection of the line segment from p0 to p1 and the tangent plane at origin.
const intersection = IntersectionTests.lineSegmentPlane(p0, p1, plane);

Return

The intersection point or undefined if there is no intersection.

Parameters

endPoint0

An end point of the line segment.

endPoint1

The other end point of the line segment.

plane

The plane.

result

The object onto which to store the result.

See also