private static int winding ( Point2D a , Point2D b , Point2D c ) { return ( int ) Math . signum ( ( b . getX ( ) - a . getX ( ) ) * ( c . getY ( ) - a . getY ( ) ) - ( b . getY ( ) - a . getY ( ) ) * ( c . getX ( ) - a . getX ( ) ) ) ; }
Determine the winding of three points . The winding is the sign of the space - the parity .