pointInsideTriangle

Determines if a point is inside a triangle.

// Returns true
const p = new Cartesian2(0.25, 0.25);
const b = pointInsideTriangle(p,
new Cartesian2(0.0, 0.0),
new Cartesian2(1.0, 0.0),
new Cartesian2(0.0, 1.0));

Return

true if the point is inside the triangle; otherwise, false.

Parameters

point

The point to test.

p0

The first point of the triangle.

p1

The second point of the triangle.

p2

The third point of the triangle.

See also