protected Point2D inverseTransformNormalized(final double x, final double y,
final Point2D ptDst)
throws ProjectionException
{
// See implementation note in class javadoc.
final Complex z = new Complex(y, x);
final Complex power = new Complex(z);
final Complex theta = new Complex();
theta.multiply(B[0], z);
for (int j=1; j<B.length; j++) {
power.multiply(power, z);
theta.addMultiply(theta, B[j], power);
}
// Increasing the number of iterations through this loop decreases
// the error in the calculation, but 3 iterations gives 10-3 accuracy.
final Complex num = new Complex();
final Complex denom = new Complex();
final Complex t = new Complex();
for (int j=0; j<3; j++) {
power.power(theta, 2);
num.addMultiply(z, A[1], power);
for (int k=2; k<A.length; k++) {
power.multiply(power, theta);
t.multiply(A[k], power);
t.multiply(t, k);
num.add(num, t);
}
power.real = 1;
power.imag = 0;
denom.copy(A[0]);
for (int k=1; k<A.length; k++) {
power.multiply(power, theta);
t.multiply(A[k], power);
t.multiply(t, k+1);
denom.add(denom, t);
}
theta.divide(num, denom);
}
final double dpsi = theta.real;