Class RobustDeterminant
java.lang.Object
org.locationtech.jts.algorithm.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
Relicensed under EDL and EPL with Permission from Olivier Devillers
Copyright (c) 1995 by INRIA Prisme Project
BP 93 06902 Sophia Antipolis Cedex, France.
All rights reserved
- Version:
- 1.7
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intorientationIndex(Coordinate p1, Coordinate p2, Coordinate q) Returns the index of the direction of the pointqrelative to a vector specified byp1-p2.static intsignOfDet2x2(double x1, double y1, double x2, double y2) Computes the sign of the determinant of the 2x2 matrix with the given entries, in a robust way.
-
Constructor Details
-
RobustDeterminant
public RobustDeterminant()
-
-
Method Details
-
signOfDet2x2
public static int signOfDet2x2(double x1, double y1, double x2, double y2) Computes the sign of the determinant of the 2x2 matrix with the given entries, in a robust way.- Returns:
- -1 if the determinant is negative,
-
orientationIndex
Returns the index of the direction of the pointqrelative to a vector specified byp1-p2.- Parameters:
p1- the origin point of the vectorp2- the final point of the vectorq- the point to compute the direction to- Returns:
- 1 if q is counter-clockwise (left) from p1-p2
-