FACT++  1.0
void palPolmo ( double  elongm,
double  phim,
double  xp,
double  yp,
double *  elong,
double *  phi,
double *  daz 
)

Definition at line 135 of file palPolmo.c.

Referenced by t_polmo().

136  {
137 
138  double sel,cel,sph,cph,xm,ym,zm,xnm,ynm,znm,
139  sxp,cxp,syp,cyp,zw,xt,yt,zt,xnt,ynt;
140 
141  /* Site mean longitude and mean geodetic latitude as a Cartesian vector */
142  sel=sin(elongm);
143  cel=cos(elongm);
144  sph=sin(phim);
145  cph=cos(phim);
146 
147  xm=cel*cph;
148  ym=sel*cph;
149  zm=sph;
150 
151  /* Rotate site vector by polar motion, Y-component then X-component */
152  sxp=sin(xp);
153  cxp=cos(xp);
154  syp=sin(yp);
155  cyp=cos(yp);
156 
157  zw=(-ym*syp+zm*cyp);
158 
159  xt=xm*cxp-zw*sxp;
160  yt=ym*cyp+zm*syp;
161  zt=xm*sxp+zw*cxp;
162 
163  /* Rotate also the geocentric direction of the terrestrial pole (0,0,1) */
164  xnm=-sxp*cyp;
165  ynm=syp;
166  znm=cxp*cyp;
167 
168  cph=sqrt(xt*xt+yt*yt);
169  if (cph == 0.0) xt=1.0;
170  sel=yt/cph;
171  cel=xt/cph;
172 
173  /* Return true longitude and true geodetic latitude of site */
174  if (xt != 0.0 || yt != 0.0) {
175  *elong=atan2(yt,xt);
176  } else {
177  *elong=0.0;
178  }
179  *phi=atan2(zt,cph);
180 
181  /* Return current azimuth of terrestrial pole seen from site position */
182  xnt=(xnm*cel+ynm*sel)*zt-znm*cph;
183  ynt=-xnm*sel+ynm*cel;
184  if (xnt != 0.0 || ynt != 0.0) {
185  *daz=atan2(-ynt,-xnt);
186  } else {
187  *daz=0.0;
188  }
189 
190 }

+ Here is the caller graph for this function: