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/riset.c

    r1719 r2551  
    22#include <math.h>
    33
    4 #include "P_.h"
    54#include "astro.h"
    65
    76/* given the true geocentric ra and dec of an object, the observer's latitude,
    8  *   lat, and a horizon displacement correction, dis, all in radians, find the
     7 *   lt, and a horizon displacement correction, dis, all in radians, find the
    98 *   local sidereal times and azimuths of rising and setting, lstr/s
    109 *   and azr/s, also all in radians, respectively.
     
    2524 */
    2625void
    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;
     26riset (double ra, double dec, double lt, double dis, double *lstr,
     27double *lsts, double *azr, double *azs, int *status)
    3328{
    3429#define EPS     (1e-9)  /* math rounding fudge - always the way, eh? */
     
    4035        int shemi;              /* flag for southern hemisphere reflection */
    4136
    42         /* reflect lat and dec if in southern hemisphere, then az back later */
    43         if ((shemi= (lat < 0.)) != 0) {
    44             lat = -lat;
     37        /* reflect lt and dec if in southern hemisphere, then az back later */
     38        if ((shemi= (lt < 0.)) != 0) {
     39            lt = -lt;
    4540            dec = -dec;
    4641        }
     
    4843        /* establish zenith angle, and its extrema */
    4944        z = (PI/2.) + dis;
    50         zmin = fabs (dec - lat);
    51         zmax = PI - fabs(dec + lat);
     45        zmin = fabs (dec - lt);
     46        zmax = PI - fabs(dec + lt);
    5247
    5348        /* first consider special cases.
     
    6459
    6560        /* compute rising hour angle -- beware found off */
    66         cos_h = (cos(z)-sin(lat)*sin(dec))/(cos(lat)*cos(dec));
     61        cos_h = (cos(z)-sin(lt)*sin(dec))/(cos(lt)*cos(dec));
    6762        if (cos_h >= 1.)
    6863            h =  0.;
     
    7368
    7469        /* compute setting azimuth -- beware found off */
    75         xaz = sin(dec)*cos(lat)-cos(dec)*cos(h)*sin(lat);
     70        xaz = sin(dec)*cos(lt)-cos(dec)*cos(h)*sin(lt);
    7671        yaz = -1.*cos(dec)*sin(h);
    7772        if (xaz == 0.) {
     
    10398
    10499/* For RCS Only -- Do Not Edit */
    105 static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: riset.c,v $ $Date: 2001-10-22 12:08:28 $ $Revision: 1.2 $ $Name: not supported by cvs2svn $"};
     100static 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.