Last change
on this file since 4074 was 4017, checked in by cmv, 14 years ago |
fichiers de Xephem 3.7.5 update, cmv 21/09/2011
|
File size:
1.2 KB
|
Rev | Line | |
---|
[1719] | 1 | #include <stdio.h>
|
---|
| 2 | #include <math.h>
|
---|
| 3 | #include <stdlib.h>
|
---|
| 4 |
|
---|
| 5 | #include "astro.h"
|
---|
| 6 |
|
---|
| 7 | /* RINGS OF SATURN by Olson, et al, BASIC Code from Sky & Telescope, May 1995.
|
---|
| 8 | * As converted from BASIC to C by pmartz@dsd.es.com (Paul Martz)
|
---|
| 9 | * Adapted to xephem by Elwood Charles Downey.
|
---|
| 10 | */
|
---|
| 11 | void
|
---|
[2551] | 12 | satrings (
|
---|
| 13 | double sb, double sl, double sr, /* Saturn hlat, hlong, sun dist */
|
---|
| 14 | double el, double er, /* Earth hlong, sun dist */
|
---|
| 15 | double JD, /* Julian date */
|
---|
| 16 | double *etiltp, double *stiltp) /* tilt from earth and sun, rads south*/
|
---|
[1719] | 17 | {
|
---|
| 18 | double t, i, om;
|
---|
| 19 | double x, y, z;
|
---|
| 20 | double la, be;
|
---|
| 21 | double s, b, sp, bp;
|
---|
| 22 |
|
---|
| 23 | t = (JD-2451545.)/365250.;
|
---|
| 24 | i = degrad(28.04922-.13*t+.0004*t*t);
|
---|
| 25 | om = degrad(169.53+13.826*t+.04*t*t);
|
---|
| 26 |
|
---|
| 27 | x = sr*cos(sb)*cos(sl)-er*cos(el);
|
---|
| 28 | y = sr*cos(sb)*sin(sl)-er*sin(el);
|
---|
| 29 | z = sr*sin(sb);
|
---|
| 30 |
|
---|
| 31 | la = atan(y/x);
|
---|
| 32 | if (x<0) la+=PI;
|
---|
| 33 | be = atan(z/sqrt(x*x+y*y));
|
---|
| 34 |
|
---|
| 35 | s = sin(i)*cos(be)*sin(la-om)-cos(i)*sin(be);
|
---|
| 36 | b = atan(s/sqrt(1.-s*s));
|
---|
| 37 | sp = sin(i)*cos(sb)*sin(sl-om)-cos(i)*sin(sb);
|
---|
| 38 | bp = atan(sp/sqrt(1.-sp*sp));
|
---|
| 39 |
|
---|
| 40 | *etiltp = b;
|
---|
| 41 | *stiltp = bp;
|
---|
| 42 | }
|
---|
[2551] | 43 |
|
---|
| 44 | /* For RCS Only -- Do Not Edit */
|
---|
[4017] | 45 | static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: rings.c,v $ $Date: 2011-09-21 16:17:50 $ $Revision: 1.8 $ $Name: not supported by cvs2svn $"};
|
---|
Note:
See
TracBrowser
for help on using the repository browser.