Ignore:
Timestamp:
Jun 15, 2004, 6:54:12 PM (21 years ago)
Author:
cmv
Message:

nouvelle version de xephem/libastro (3.6) cmv 15/6/04

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaExt/XephemAstroLib/aa_hadec.c

    r1719 r2551  
    55#include <math.h>
    66
    7 #include "P_.h"
    87#include "astro.h"
    98
    10 static void aaha_aux P_((double lat, double x, double y, double *p, double *q));
     9static void aaha_aux (double lt, double x, double y, double *p, double *q);
    1110
    12 /* given geographical latitude (n+, radians), lat, altitude (up+, radians),
     11/* given geographical latitude (n+, radians), lt, altitude (up+, radians),
    1312 * alt, and azimuth (angle round to the east from north+, radians),
    1413 * return hour angle (radians), ha, and declination (radians), dec.
    1514 */
    1615void
    17 aa_hadec (lat, alt, az, ha, dec)
    18 double lat;
    19 double alt, az;
    20 double *ha, *dec;
     16aa_hadec (
     17double lt,
     18double alt, double az,
     19double *ha, double *dec)
    2120{
    22         aaha_aux (lat, az, alt, ha, dec);
     21        aaha_aux (lt, az, alt, ha, dec);
    2322        if (*ha > PI)
    2423            *ha -= 2*PI;
    2524}
    2625
    27 /* given geographical (n+, radians), lat, hour angle (radians), ha, and
     26/* given geographical (n+, radians), lt, hour angle (radians), ha, and
    2827 * declination (radians), dec, return altitude (up+, radians), alt, and
    2928 * azimuth (angle round to the east from north+, radians),
    3029 */
    3130void
    32 hadec_aa (lat, ha, dec, alt, az)
    33 double lat;
    34 double ha, dec;
    35 double *alt, *az;
     31hadec_aa (
     32double lt,
     33double ha, double dec,
     34double *alt, double *az)
    3635{
    37         aaha_aux (lat, ha, dec, az, alt);
     36        aaha_aux (lt, ha, dec, az, alt);
    3837}
    3938
     
    4342 */
    4443double
    45 geoc_lat (phi)
    46 double phi;
     44geoc_lat (
     45double phi)
    4746{
    4847#define MAXLAT  degrad(89.9999) /* avoid tan() greater than this */
     
    5655 */
    5756static void
    58 aaha_aux (lat, x, y, p, q)
    59 double lat;
    60 double x, y;
    61 double *p, *q;
     57aaha_aux (
     58double lt,
     59double x, double y,
     60double *p, double *q)
    6261{
    63         static double last_lat = -3434, slat, clat;
     62        static double last_lt = -3434, slt, clt;
    6463        double cap, B;
    6564
    66         if (lat != last_lat) {
    67             slat = sin(lat);
    68             clat = cos(lat);
    69             last_lat = lat;
     65        if (lt != last_lt) {
     66            slt = sin(lt);
     67            clt = cos(lt);
     68            last_lt = lt;
    7069        }
    7170
    72         solve_sphere (-x, PI/2-y, slat, clat, &cap, &B);
     71        solve_sphere (-x, PI/2-y, slt, clt, &cap, &B);
    7372        *p = B;
    7473        *q = PI/2 - acos(cap);
     
    7675
    7776/* For RCS Only -- Do Not Edit */
    78 static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: aa_hadec.c,v $ $Date: 2001-10-22 12:08:26 $ $Revision: 1.2 $ $Name: not supported by cvs2svn $"};
     77static 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.