cdlam = Math.cos(sdlam = lplam + R110);
sdlam = Math.sin(sdlam);
z = S20 * sphi + C20 * cphi * cdlam;
if (Math.abs(z) > 1.) {
if (Math.abs(z) > ONEEPS)
throw new ProjectionException("F");
else z = z < 0. ? -1. : 1.;
} else
z = Math.acos(z);
if (tphi != Double.MAX_VALUE)
Az = Math.atan2(sdlam, (C20 * tphi - S20 * cdlam));
Av = Azab;
out.y = rhoc;
} else {
z = S45 * (sphi + cphi * cdlam);
if (Math.abs(z) > 1.) {
if (Math.abs(z) > ONEEPS)
throw new ProjectionException("F");
else z = z < 0. ? -1. : 1.;
} else
z = Math.acos(z);
Av = Azba;
out.y = -rhoc;
}
if (z < 0.) throw new ProjectionException("F");
r = F * (t = Math.pow(Math.tan(.5 * z), n));
if ((al = .5 * (R104 - z)) < 0.)
throw new ProjectionException("F");
al = (t + Math.pow(al, n)) / T;
if (Math.abs(al) > 1.) {
if (Math.abs(al) > ONEEPS)
throw new ProjectionException("F");
else al = al < 0. ? -1. : 1.;
} else
al = Math.acos(al);
if (Math.abs(t = n * (Av - Az)) < al)
r /= Math.cos(al + (tag ? t : -t));