@Override public double cos(int step){
  step=Math.abs(step) % steps;
  if (step < costable.length) {
    return costable[step];
  }
  return costable[steps - step];
}

@ Override public double cos ( int step ) { step = Math . abs ( step ) % steps ; if ( step < costable . length ) { return costable [ step ] ; } return costable [ steps - step ] ; }
get cosine by step value .
