Class S2Predicates.CompareEdgeDirections

java.lang.Object
com.google.common.geometry.S2Predicates.CompareEdgeDirections
Enclosing class:
S2Predicates

static class S2Predicates.CompareEdgeDirections extends Object
A test to compare whether two edges are closer to proceeding in the same direction or in opposite directions around the sphere, essentially signum((AxB)x(CxD)). Returns -1, 0, or +1 according to whether the normal of edge AB has negative, zero, or positive dot product with the normal of edge CD, and may return 0 if the relation is indeterminate.
  • Constructor Details

    • CompareEdgeDirections

      private CompareEdgeDirections()
      No instantiation.
  • Method Details

    • triage

      public static int triage(S2Point a, S2Point b, S2Point c, S2Point d)
      Returns a cosine-based test result. Fast but has a wide margin of uncertainty.
    • exact

      public static int exact(S2Point a, S2Point b, S2Point c, S2Point d)
      Returns a BigDecimal-based test result. Exact but very slow.
    • exact

      public static int exact(BigPoint a, BigPoint b, BigPoint c, BigPoint d)
      Returns a BigDecimal-based test result. Exact but very slow.