A 2d exact arithmetic point-in-triangle predicate for arbitrary triangle orientation.

Namespace:  ceometric.ComputationalGeometry
Assembly:  ceometric.ComputationalGeometry (in ceometric.ComputationalGeometry.dll) Version: 2.4.0.0 (2.4.0.0)

Syntax

C#
public static double InTriangle2dArbitraryExact(
	Point vertex1,
	Point vertex2,
	Point vertex3,
	Point point
)
Visual Basic (Declaration)
Public Shared Function InTriangle2dArbitraryExact ( _
	vertex1 As Point, _
	vertex2 As Point, _
	vertex3 As Point, _
	point As Point _
) As Double
Visual C++
public:
static double InTriangle2dArbitraryExact(
	Point^ vertex1, 
	Point^ vertex2, 
	Point^ vertex3, 
	Point^ point
)

Parameters

vertex1
Type: ceometric.VectorGeometry..::.Point
A vertex of a 2d triangle.
vertex2
Type: ceometric.VectorGeometry..::.Point
A vertex of a 2d triangle.
vertex3
Type: ceometric.VectorGeometry..::.Point
A vertex of a 2d triangle.
point
Type: ceometric.VectorGeometry..::.Point
A 2d point.

Return Value

For a clockwise OR counterclockwise arrangement of the vertices, the predicate is
  • 1 if point lies inside the triangle.
  • 0 if point lies on the perimeter of the triangle.
  • -1 if point lies outside the triangle.
  • NaN if the triangle is degenerate.

See Also