protected int legalIndex(int index){
  while (index >= points.size())   index-=points.size();
  while (index < 0) {
    index+=points.size();
  }
  return index;
}

protected int legalIndex ( int index ) { while ( index >= points . size ( ) ) index -= points . size ( ) ; while ( index < 0 ) { index += points . size ( ) ; } return index ; }
compute a legal point index from a possibly illegal one , that may have wrapped .
