Adjust an unrefracted Cartesian vector to include the effect of atmospheric refraction, using the simple A tan z + B tan3 z model.
vu double unrefracted position of the source (az/el 3-vector) refa double A: tan z coefficient (radian) refb double B: tan3 z coefficient (radian)
*vr double refracted position of the source (az/el 3-vector) Note that this routine applies the adjustment for refraction in the opposite sense to the usual one - it takes an unrefracted (in vacuo) position and produces an observed (refracted) position, whereas the basic A tan z + B tan3 z model strictly applies to the case where a refracted position is available and must be corrected for refraction. This requires an inverted form of the refraction expression; the algorithm used here is based on two iterations of the Newton-Raphson method. See also the routine slaRefz, which performs the adjustment to the zenith distance rather than in Cartesian az/el coordinates. The results from slaRefz are slightly more accurate (in a numerical sense) to those produced by the present routine, due to the various approximations used in the latter for simplicity and speed. To avoid arithmetic overflow at the horizon, the z-component is artificially constrained to the positive non-zero range. The vector vu must be of unit length; No check is made. P.T.Wallace Starlink 31 October 1993