Changeset 2551 in Sophya for trunk/SophyaExt/XephemAstroLib/riset.c
- Timestamp:
- Jun 15, 2004, 6:54:12 PM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaExt/XephemAstroLib/riset.c
r1719 r2551 2 2 #include <math.h> 3 3 4 #include "P_.h"5 4 #include "astro.h" 6 5 7 6 /* given the true geocentric ra and dec of an object, the observer's latitude, 8 * l at, and a horizon displacement correction, dis, all in radians, find the7 * lt, and a horizon displacement correction, dis, all in radians, find the 9 8 * local sidereal times and azimuths of rising and setting, lstr/s 10 9 * and azr/s, also all in radians, respectively. … … 25 24 */ 26 25 void 27 riset (ra, dec, lat, dis, lstr, lsts, azr, azs, status) 28 double ra, dec; 29 double lat, dis; 30 double *lstr, *lsts; 31 double *azr, *azs; 32 int *status; 26 riset (double ra, double dec, double lt, double dis, double *lstr, 27 double *lsts, double *azr, double *azs, int *status) 33 28 { 34 29 #define EPS (1e-9) /* math rounding fudge - always the way, eh? */ … … 40 35 int shemi; /* flag for southern hemisphere reflection */ 41 36 42 /* reflect l at and dec if in southern hemisphere, then az back later */43 if ((shemi= (l at < 0.)) != 0) {44 l at = -lat;37 /* reflect lt and dec if in southern hemisphere, then az back later */ 38 if ((shemi= (lt < 0.)) != 0) { 39 lt = -lt; 45 40 dec = -dec; 46 41 } … … 48 43 /* establish zenith angle, and its extrema */ 49 44 z = (PI/2.) + dis; 50 zmin = fabs (dec - l at);51 zmax = PI - fabs(dec + l at);45 zmin = fabs (dec - lt); 46 zmax = PI - fabs(dec + lt); 52 47 53 48 /* first consider special cases. … … 64 59 65 60 /* compute rising hour angle -- beware found off */ 66 cos_h = (cos(z)-sin(l at)*sin(dec))/(cos(lat)*cos(dec));61 cos_h = (cos(z)-sin(lt)*sin(dec))/(cos(lt)*cos(dec)); 67 62 if (cos_h >= 1.) 68 63 h = 0.; … … 73 68 74 69 /* compute setting azimuth -- beware found off */ 75 xaz = sin(dec)*cos(l at)-cos(dec)*cos(h)*sin(lat);70 xaz = sin(dec)*cos(lt)-cos(dec)*cos(h)*sin(lt); 76 71 yaz = -1.*cos(dec)*sin(h); 77 72 if (xaz == 0.) { … … 103 98 104 99 /* For RCS Only -- Do Not Edit */ 105 static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: riset.c,v $ $Date: 200 1-10-22 12:08:28 $ $Revision: 1.2$ $Name: not supported by cvs2svn $"};100 static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: riset.c,v $ $Date: 2004-06-15 16:52:40 $ $Revision: 1.3 $ $Name: not supported by cvs2svn $"};
Note:
See TracChangeset
for help on using the changeset viewer.