code: public static int rationalPoint(Shape shape, int p) {
  		while (p < 0) {
  			p += shape.getPointCount();
  		}
  		while (p >= shape.getPointCount()) {
  			p -=  shape.getPointCount();
  		}
  		
  		return p;
  	}
docs: Rationalise a point in terms of a given shape
  
  @param shape The shape
  @param p The index of the point
  @return The index that is rational for the shape