code: public static int distanceP(int index0, int index1, int size) {
  		int difference = index1-index0;
  		if( difference < 0 ) {
  			difference = size+difference;
  		}
  		return difference;
  	}
docs: Returns how many elements away in the positive direction you need to travel to get from
  index0 to index1.
  
  @param index0 element in circular buffer
  @param index1 element in circular buffer
  @param size size of the circular buffer
  @return positive distance