103 const double CELMIN = 1e-6;
104 const double SELMIN = 0.05;
106 double v[3], x, y, z, xhd, yhd, zhd, f, xhdt, yhdt, zhdt,
107 xaet, yaet, zaet, azobs, r, tz, w, del, cosdel,
108 xaeo, yaeo, zaeo, zdobs, hmobs, dcobs, raobs;
119 xhd = x + astrom->
xpl*z;
120 yhd = y - astrom->
ypl*z;
121 zhd = z - astrom->
xpl*x + astrom->
ypl*y;
124 f = ( 1.0 - astrom->
diurab*yhd );
126 yhdt = f * ( yhd + astrom->
diurab );
130 xaet = astrom->
sphi*xhdt - astrom->
cphi*zhdt;
132 zaet = astrom->
cphi*xhdt + astrom->
sphi*zhdt;
135 azobs = ( xaet != 0.0 || yaet != 0.0 ) ? atan2(yaet,-xaet) : 0.0;
142 r = sqrt(xaet*xaet + yaet*yaet);
143 r = r > CELMIN ? r : CELMIN;
144 z = zaet > SELMIN ? zaet : SELMIN;
148 w = astrom->
refb*tz*tz;
149 del = ( astrom->
refa + w ) * tz /
150 ( 1.0 + ( astrom->
refa + 3.0*w ) / ( z*z ) );
153 cosdel = 1.0 - del*del/2.0;
154 f = cosdel - del*z/r;
157 zaeo = cosdel*zaet + del*r;
160 zdobs = atan2(sqrt(xaeo*xaeo+yaeo*yaeo), zaeo);
163 v[0] = astrom->
sphi*xaeo + astrom->
cphi*zaeo;
165 v[2] = - astrom->
cphi*xaeo + astrom->
sphi*zaeo;
168 eraC2s ( v, &hmobs, &dcobs );
171 raobs = astrom->
eral + hmobs;
void eraS2c(double theta, double phi, double c[3])
void eraC2s(double p[3], double *theta, double *phi)