FACT++  1.0
void palAltaz ( double  ha,
double  dec,
double  phi,
double *  az,
double *  azd,
double *  azdd,
double *  el,
double *  eld,
double *  eldd,
double *  pa,
double *  pad,
double *  padd 
)

Definition at line 132 of file palAltaz.c.

References PAL__D2PI, and PAL__DPI.

Referenced by t_altaz().

135  {
136 
137  const double TINY = 1E-30;
138 
139  double sh,ch,sd,cd,sp,cp,chcd,sdcp,x,y,z,rsq,r,a,e,c,s,
140  q,qd,ad,ed,edr,add,edd,qdd;
141 
142 
143  /* Useful functions */
144  sh=sin(ha);
145  ch=cos(ha);
146  sd=sin(dec);
147  cd=cos(dec);
148  sp=sin(phi);
149  cp=cos(phi);
150  chcd=ch*cd;
151  sdcp=sd*cp;
152  x=-chcd*sp+sdcp;
153  y=-sh*cd;
154  z=chcd*cp+sd*sp;
155  rsq=x*x+y*y;
156  r=sqrt(rsq);
157 
158  /* Azimuth and elevation */
159  if (rsq == 0.0) {
160  a=0.0;
161  } else {
162  a=atan2(y,x);
163  }
164  if (a < 0.0) a += PAL__D2PI;
165  e=atan2(z,r);
166 
167  /* Parallactic angle */
168  c=cd*sp-ch*sdcp;
169  s=sh*cp;
170  if (c*c+s*s > 0) {
171  q=atan2(s,c);
172  } else {
173  q= PAL__DPI - ha;
174  }
175 
176  /* Velocities and accelerations (clamped at zenith/nadir) */
177  if (rsq < TINY) {
178  rsq=TINY;
179  r=sqrt(rsq);
180  }
181  qd=-x*cp/rsq;
182  ad=sp+z*qd;
183  ed=cp*y/r;
184  edr=ed/r;
185  add=edr*(z*sp+(2.0-rsq)*qd);
186  edd=-r*qd*ad;
187  qdd=edr*(sp+2.0*z*qd);
188 
189  /* Results */
190  *az=a;
191  *azd=ad;
192  *azdd=add;
193  *el=e;
194  *eld=ed;
195  *eldd=edd;
196  *pa=q;
197  *pad=qd;
198  *padd=qdd;
199 
200 }
static const double PAL__DPI
Definition: palmac.h:63
static const double PAL__D2PI
Definition: palmac.h:66

+ Here is the caller graph for this function: