Class S2Predicates.CompareEdgeDirections

  • Enclosing class:
    S2Predicates

    static class S2Predicates.CompareEdgeDirections
    extends java.lang.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 Detail

      • CompareEdgeDirections

        private CompareEdgeDirections()
        No instantiation.
    • Method Detail

      • 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.