Changeset 2551 in Sophya for trunk/SophyaExt/XephemAstroLib/aa_hadec.c
- Timestamp:
- Jun 15, 2004, 6:54:12 PM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaExt/XephemAstroLib/aa_hadec.c
r1719 r2551 5 5 #include <math.h> 6 6 7 #include "P_.h"8 7 #include "astro.h" 9 8 10 static void aaha_aux P_((double lat, double x, double y, double *p, double *q));9 static void aaha_aux (double lt, double x, double y, double *p, double *q); 11 10 12 /* given geographical latitude (n+, radians), l at, altitude (up+, radians),11 /* given geographical latitude (n+, radians), lt, altitude (up+, radians), 13 12 * alt, and azimuth (angle round to the east from north+, radians), 14 13 * return hour angle (radians), ha, and declination (radians), dec. 15 14 */ 16 15 void 17 aa_hadec ( lat, alt, az, ha, dec)18 double l at;19 double alt, az;20 double *ha, *dec;16 aa_hadec ( 17 double lt, 18 double alt, double az, 19 double *ha, double *dec) 21 20 { 22 aaha_aux (l at, az, alt, ha, dec);21 aaha_aux (lt, az, alt, ha, dec); 23 22 if (*ha > PI) 24 23 *ha -= 2*PI; 25 24 } 26 25 27 /* given geographical (n+, radians), l at, hour angle (radians), ha, and26 /* given geographical (n+, radians), lt, hour angle (radians), ha, and 28 27 * declination (radians), dec, return altitude (up+, radians), alt, and 29 28 * azimuth (angle round to the east from north+, radians), 30 29 */ 31 30 void 32 hadec_aa ( lat, ha, dec, alt, az)33 double l at;34 double ha, d ec;35 double *alt, *az;31 hadec_aa ( 32 double lt, 33 double ha, double dec, 34 double *alt, double *az) 36 35 { 37 aaha_aux (l at, ha, dec, az, alt);36 aaha_aux (lt, ha, dec, az, alt); 38 37 } 39 38 … … 43 42 */ 44 43 double 45 geoc_lat ( phi)46 double phi ;44 geoc_lat ( 45 double phi) 47 46 { 48 47 #define MAXLAT degrad(89.9999) /* avoid tan() greater than this */ … … 56 55 */ 57 56 static void 58 aaha_aux ( lat, x, y, p, q)59 double l at;60 double x, y;61 double *p, *q;57 aaha_aux ( 58 double lt, 59 double x, double y, 60 double *p, double *q) 62 61 { 63 static double last_l at = -3434, slat, clat;62 static double last_lt = -3434, slt, clt; 64 63 double cap, B; 65 64 66 if (l at != last_lat) {67 sl at = sin(lat);68 cl at = cos(lat);69 last_l at = lat;65 if (lt != last_lt) { 66 slt = sin(lt); 67 clt = cos(lt); 68 last_lt = lt; 70 69 } 71 70 72 solve_sphere (-x, PI/2-y, sl at, clat, &cap, &B);71 solve_sphere (-x, PI/2-y, slt, clt, &cap, &B); 73 72 *p = B; 74 73 *q = PI/2 - acos(cap); … … 76 75 77 76 /* For RCS Only -- Do Not Edit */ 78 static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: aa_hadec.c,v $ $Date: 200 1-10-22 12:08:26 $ $Revision: 1.2$ $Name: not supported by cvs2svn $"};77 static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: aa_hadec.c,v $ $Date: 2004-06-15 16:52:37 $ $Revision: 1.3 $ $Name: not supported by cvs2svn $"};
Note:
See TracChangeset
for help on using the changeset viewer.