public static int robustCCW(S2Point a,S2Point b,S2Point c){
  return robustCCW(a,b,c,S2Point.crossProd(a,b));
}

public static int robustCCW ( S2Point a , S2Point b , S2Point c ) { return robustCCW ( a , b , c , S2Point . crossProd ( a , b ) ) ; }
warning ! this requires arbitrary precision arithmetic to be truly robust . this means that for nearly colinear ab and ac , this function may return the wrong answer . < p > like simpleccw ( ) , but returns + 1 if the points are counterclockwise and - 1 if the points are clockwise . it satisfies the following conditions : ( 1 ) robustccw ( a , b , c ) = = 0 if and only if a = = b , b = = c , or c = = a ( 2 ) robustccw ( b , c , a ) = = robustccw ( a , b , c ) for all a , b , c ( 3 ) robustccw ( c , b , a ) = = - robustccw ( a , b , c ) for all a , b , c in other words : ( 1 ) the result is zero if and only if two points are the same . ( 2 ) rotating the order of the arguments does not affect the result . ( 3 ) exchanging any two arguments inverts the result . this function is essentially like taking the sign of the determinant of a , b , c , except that it has additional logic to make sure that the above properties hold even when the three points are coplanar , and to deal with the limitations of floating - point arithmetic . note : a , b and c are expected to be of unit length . otherwise , the results are undefined .
