Class: RobustDeterminant

jsts.algorithm.RobustDeterminant

new RobustDeterminant()

Implements an algorithm to compute the sign of a 2x2 determinant for double precision values robustly. It is a direct translation of code developed by Olivier Devillers.

The original code carries the following copyright notice:

```************************************************************************
Author : Olivier Devillers
Olivier.Devillers@sophia.inria.fr
http:/www.inria.fr:/prisme/personnel/devillers/anglais/determinant.html

the LGPL (2012-02-16) saying "It is ok for LGPL distribution."

*************************************************************************

*************************************************************************
Copyright (c) 1995  by  INRIA Prisme Project
BP 93 06902 Sophia Antipolis Cedex, France.
*************************************************************************
```
Source:

Methods

(static) orientationIndex(p1, p2, q)

Returns the index of the direction of the point `q` relative to a vector specified by `p1-p2`.
Parameters:
Name Type Description
`p1` the origin point of the vector
`p2` the final point of the vector
`q` the point to compute the direction to
Source:
Returns:
• 1 if q is counter-clockwise (left) from p1-p2
• -1 if q is clockwise (right) from p1-p2
• 0 if q is collinear with p1-p2

(static) signOfDet2x2(x1, y1, x2, y2) → {Number|Number|Number}

Computes the sign of the determinant of the 2x2 matrix with the given entries, in a robust way.
Parameters:
Name Type Description
`x1` Number X-1.
`y1` Number Y-1.
`x2` Number X-2.
`y2` Number Y-1.
Source:
Returns:
• -1 if the determinant is negative,.
Type
Number
• 1 if the determinant is positive,.
Type
Number
• 0 if the determinant is 0.
Type
Number