Changeset 2818 in Sophya for trunk/SophyaExt/XephemAstroLib/misc.c
- Timestamp:
- Aug 21, 2005, 12:02:40 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaExt/XephemAstroLib/misc.c
r2653 r2818 180 180 } 181 181 182 /* convert ra to ha, in range -PI .. PI.182 /* convert ra to ha, in range 0..2*PI 183 183 * need dec too if not already apparent. 184 184 */ … … 192 192 now_lst (np, &lst); 193 193 ha = hrrad(lst) - ra; 194 if (ha < -PI) ha += 2*PI;195 if (ha > PI) ha -= 2*PI;194 if (ha < 0) 195 ha += 2*PI; 196 196 *hap = ha; 197 } 198 199 /* find Greenwich Hour Angle of the given object at the given time, 0..2*PI. 200 */ 201 void 202 gha (Now *np, Obj *op, double *ghap) 203 { 204 Now n = *np; 205 Obj o = *op; 206 double tmp; 207 208 n.n_epoch = EOD; 209 n.n_lng = 0.0; 210 n.n_lat = 0.0; 211 obj_cir (&n, &o); 212 now_lst (&n, &tmp); 213 tmp = hrrad(tmp) - o.s_ra; 214 if (tmp < 0) 215 tmp += 2*PI; 216 *ghap = tmp; 197 217 } 198 218 … … 481 501 482 502 /* For RCS Only -- Do Not Edit */ 483 static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: misc.c,v $ $Date: 2005-0 3-07 16:47:18 $ $Revision: 1.5$ $Name: not supported by cvs2svn $"};503 static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: misc.c,v $ $Date: 2005-08-21 10:02:38 $ $Revision: 1.6 $ $Name: not supported by cvs2svn $"};
Note:
See TracChangeset
for help on using the changeset viewer.