@Override public double[] transform(double[] coord) throws IllegalCoordinateException, CoordinateOperationException { boolean iter = false; int count = 0; for (int i = 0; i < realValueIndex.length; i++) { iter = iter || Math.abs(coord[realValueIndex[i]] - coord[calculatedValueIndex[i]]) > tolerance[i]; } while (iter) { coord = op.transform(coord); iter = false; for (int i = 0; i < realValueIndex.length; i++) { iter = iter || Math.abs(coord[realValueIndex[i]] - coord[calculatedValueIndex[i]]) > tolerance[i]; } if (++count > maxIterations ) throw new TooManyIterationsException(this, count); } return coord; }