quaeratin
Version:
An extended precision floating point library (as per Shewchuk) - precision only limited by overflow / underflow
22 lines (21 loc) • 998 B
TypeScript
/**
* * Ported from [Shewchuk](http://docs.ros.org/kinetic/api/asr_approx_mvbb/html/Predicates_8cpp_source.html)
* * see also https://people.eecs.berkeley.edu/~jrs/papers/robustr.pdf
*
* * 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.
*/
declare function orient2d(A: number[], B: number[], C: number[]): number;
export { orient2d };