Function geometry_predicates::predicates::orient2d[][src]

pub fn orient2d(pa: [f64; 2], pb: [f64; 2], pc: [f64; 2]) -> f64

Adaptive exact 2D orientation test. Robust.

Return a positive value if the points pa, pb, and pc occur in counterclockwise order; a negative value if they occur in clockwise order; and zero if they are collinear. The result is also a rough approximation of twice the signed area of the triangle defined by the three points.

The result returned is the determinant of a matrix. This determinant is computed adaptively, in the sense that exact arithmetic is used only to the degree it is needed to ensure that the returned value has the correct sign. Hence, orient2d() is usually quite fast, but will run more slowly when the input points are collinear or nearly so.