Package com.google.common.geometry
Class S2Predicates.CompareDistances
java.lang.Object
com.google.common.geometry.S2Predicates.CompareDistances
- Enclosing class:
S2Predicates
A set of tests to determine which of two points is closer to a reference point. Generally much
faster then computing even one exact distance, since most points are "obviously" ordered w.r.t.
the reference point. Returns -1, 0, or +1 according to whether AX invalid input: '<' BX, A == B, or AX > BX
respectively, and may return 0 if the result is indeterminate.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int
Returns a BigDecimal-based test result, which is slow but handle all input.static int
Returns a BigDecimal-based test result, which is slow but handle all input.static int
Given that the exact test returned 0, returns a Simulation of Simplicity symbolic perturbation-based test result to select a consistent non-zero result.static int
Returns a cosine-based test result.static int
triageSin2
(S2Point x, S2Point a, S2Point b) Returns the test result using a more accurate sine strategy, which only allows angles either both below -90 or both above +90 degrees.
-
Constructor Details
-
CompareDistances
private CompareDistances()No instantiation.
-
-
Method Details
-
triageCos
Returns a cosine-based test result. It handles all angles, is the fastest implementation, but has a wide margin of uncertainty. -
triageSin2
Returns the test result using a more accurate sine strategy, which only allows angles either both below -90 or both above +90 degrees. -
exact
Returns a BigDecimal-based test result, which is slow but handle all input. -
exact
Returns a BigDecimal-based test result, which is slow but handle all input. -
sos
Given that the exact test returned 0, returns a Simulation of Simplicity symbolic perturbation-based test result to select a consistent non-zero result.
-