FACT++  1.0
void palDtps2c ( double  xi,
double  eta,
double  ra,
double  dec,
double *  raz1,
double *  decz1,
double *  raz2,
double *  decz2,
int *  n 
)

Definition at line 107 of file palDtps2c.c.

References eraAnp().

Referenced by t_tp().

109  {
110 
111  double x2;
112  double y2;
113  double sd;
114  double cd;
115  double sdf;
116  double r2;
117 
118  x2 = xi * xi;
119  y2 = eta * eta;
120  sd = sin(dec);
121  cd = cos(dec);
122  sdf = sd * sqrt(x2 + 1. + y2);
123  r2 = cd * cd * (y2 + 1.) - sd * sd * x2;
124  if (r2 >= 0.) {
125  double r;
126  double s;
127  double c;
128 
129  r = sqrt(r2);
130  s = sdf - eta * r;
131  c = sdf * eta + r;
132  if (xi == 0. && r == 0.) {
133  r = 1.;
134  }
135  *raz1 = eraAnp(ra - atan2(xi, r));
136  *decz1 = atan2(s, c);
137  r = -r;
138  s = sdf - eta * r;
139  c = sdf * eta + r;
140  *raz2 = eraAnp(ra - atan2(xi, r));
141  *decz2 = atan2(s, c);
142  if (fabs(sdf) < 1.) {
143  *n = 1;
144  } else {
145  *n = 2;
146  }
147  } else {
148  *n = 0;
149  }
150  return;
151 }
double eraAnp(double a)
Definition: anp.c:3

+ Here is the call graph for this function:

+ Here is the caller graph for this function: