[][src]Function geometry_predicates::incircle

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

Adaptive exaact 2D incircle test. Robust.

Return a positive value if the point pd lies inside the circle passing through pa, pb, and pc; a negative value if it lies outside; and zero if the four points are cocircular. The points pa, pb, and pc must be in counterclockwise order, or the sign of the result will be reversed.

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, incircle() is usually quite fast, but will run more slowly when the input points are cocircular or nearly so.