public static int rationalPoint ( Shape shape , int p ) { while ( p < 0 ) { p += shape . getPointCount ( ) ; } while ( p >= shape . getPointCount ( ) ) { p -= shape . getPointCount ( ) ; } return p ; }
Rationalise a point in terms of a given shape