For each point, the rotation by the projection angle is first removed
(variables xr and yr):
Since
, the trigonometric functions of
are rational functions of
:
and |
(60) |
Injecting them in the spherical trigonometry relations of
section
gives the cartesian coordinates of the
point on the celestial sphere, scaled by the positive factor
(variables rho2, cx, cy, and cz):
The scaling factor cancels in the
atan2 functions, and the
celestial coordinates are:
where
is computed with the Fortran intrinsic
function hypot (variable cxy). At the celestial poles
(
), the right ascension is undefined and is set to
. The reasons for this formulation are:
- no trigonometric function of
is evaluated, and there is
no special case for the reference point:
gives
;
- computing
with
atan2 is accurate everywhere,
while
loses accuracy close to the celestial poles (its
derivative is infinite there);
- the antipode convention of the other direction is consistently
inverted:
is still representable in double precision,
and the formulae give back the antipode
.