]> git.mxchange.org Git - flightgear.git/blob - Simulator/Time/moonpos.cxx
Clean ups and reorganizations:
[flightgear.git] / Simulator / Time / moonpos.cxx
1 // moonpos.cxx (basically, this is a slightly modified version of the 'sunpos.cxx' file, adapted from XEarth)
2
3 // kirk johnson
4 // july 1993
5 //
6 // code for calculating the position on the earth's surface for which
7 // the moon is directly overhead (adapted from _practical astronomy
8 // with your calculator, third edition_, peter duffett-smith,
9 // cambridge university press, 1988.)
10 //
11 // Copyright (C) 1989, 1990, 1993, 1994, 1995 Kirk Lauritz Johnson
12 //
13 // Parts of the source code (as marked) are:
14 //   Copyright (C) 1989, 1990, 1991 by Jim Frost
15 //   Copyright (C) 1992 by Jamie Zawinski <jwz@lucid.com>
16 //
17 // Permission to use, copy, modify and freely distribute xearth for
18 // non-commercial and not-for-profit purposes is hereby granted
19 // without fee, provided that both the above copyright notice and this
20 // permission notice appear in all copies and in supporting
21 // documentation.
22 //
23 // The author makes no representations about the suitability of this
24 // software for any purpose. It is provided "as is" without express or
25 // implied warranty.
26 //
27 // THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
28 // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
29 // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT
30 // OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
31 // LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
32 // NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
33 // CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
34 //
35 // $Id$
36 // (Log is kept at end of this file)
37
38
39 #ifdef HAVE_CONFIG_H
40 #  include <config.h>
41 #endif
42
43 #include "Include/compiler.h"
44 #ifdef FG_HAVE_STD_INCLUDES
45 #  include <cmath>
46 #  include <cstdio>
47 #  include <ctime>
48 #else
49 #  include <math.h>
50 #  include <stdio.h>
51 #  include <time.h>
52 #endif
53
54
55 //#include <Astro/orbits.hxx>
56 #include <Astro/solarsystem.hxx>
57 #include <Debug/logstream.hxx>
58 #include <Include/fg_constants.h>
59 #include <Main/views.hxx>
60 #include <Math/fg_geodesy.hxx>
61 #include <Math/mat3.h>
62 #include <Math/point3d.hxx>
63 #include <Math/polar3d.hxx>
64 #include <Math/vector.hxx>
65 #include <Scenery/scenery.hxx>
66
67 #include "fg_time.hxx"
68 #include "moonpos.hxx"
69
70 extern SolarSystem *solarSystem;
71
72 #undef E
73
74
75 /*
76  * the epoch upon which these astronomical calculations are based is
77  * 1990 january 0.0, 631065600 seconds since the beginning of the
78  * "unix epoch" (00:00:00 GMT, Jan. 1, 1970)
79  *
80  * given a number of seconds since the start of the unix epoch,
81  * DaysSinceEpoch() computes the number of days since the start of the
82  * astronomical epoch (1990 january 0.0)
83  */
84
85 #define EpochStart           (631065600)
86 #define DaysSinceEpoch(secs) (((secs)-EpochStart)*(1.0/(24*3600)))
87
88 /*
89  * assuming the apparent orbit of the moon about the earth is circular,
90  * the rate at which the orbit progresses is given by RadsPerDay --
91  * FG_2PI radians per orbit divided by 365.242191 days per year:
92  */
93
94 #define RadsPerDay (FG_2PI/365.242191)
95
96 /*
97  * details of moon's apparent orbit at epoch 1990.0 (after
98  * duffett-smith, table 6, section 46)
99  *
100  * Epsilon_g    (ecliptic longitude at epoch 1990.0) 279.403303 degrees
101  * OmegaBar_g   (ecliptic longitude of perigee)      282.768422 degrees
102  * Eccentricity (eccentricity of orbit)                0.016713
103  */
104
105 #define Epsilon_g    (279.403303*(FG_2PI/360))
106 #define OmegaBar_g   (282.768422*(FG_2PI/360))
107 #define Eccentricity (0.016713)
108
109 /*
110  * MeanObliquity gives the mean obliquity of the earth's axis at epoch
111  * 1990.0 (computed as 23.440592 degrees according to the method given
112  * in duffett-smith, section 27)
113  */
114 #define MeanObliquity (23.440592*(FG_2PI/360))
115
116 /* static double solve_keplers_equation(double); */
117 /* static double moon_ecliptic_longitude(time_t); */
118 static void   ecliptic_to_equatorial(double, double, double *, double *);
119 static double julian_date(int, int, int);
120 static double GST(time_t);
121
122 /*
123  * solve Kepler's equation via Newton's method
124  * (after duffett-smith, section 47)
125  */
126 /*
127 static double solve_keplers_equation(double M) {
128     double E;
129     double delta;
130
131     E = M;
132     while (1) {
133         delta = E - Eccentricity*sin(E) - M;
134         if (fabs(delta) <= 1e-10) break;
135         E -= delta / (1 - Eccentricity*cos(E));
136     }
137
138     return E;
139 }
140 */
141
142
143 /* compute ecliptic longitude of moon (in radians) (after
144  * duffett-smith, section 47) */
145 /*
146 static double moon_ecliptic_longitude(time_t ssue) {
147     // time_t ssue;              //  seconds since unix epoch
148     double D, N;
149     double M_moon, E;
150     double v;
151
152     D = DaysSinceEpoch(ssue);
153
154     N = RadsPerDay * D;
155     N = fmod(N, FG_2PI);
156     if (N < 0) N += FG_2PI;
157
158     M_moon = N + Epsilon_g - OmegaBar_g;
159     if (M_moon < 0) M_moon += FG_2PI;
160
161     E = solve_keplers_equation(M_moon);
162     v = 2 * atan(sqrt((1+Eccentricity)/(1-Eccentricity)) * tan(E/2));
163
164     return (v + OmegaBar_g);
165 }
166 */
167
168
169 /* convert from ecliptic to equatorial coordinates (after
170  * duffett-smith, section 27) */
171
172 static void ecliptic_to_equatorial(double lambda, double beta, 
173                                    double *alpha, double *delta) {
174     /* double  lambda;            ecliptic longitude       */
175     /* double  beta;              ecliptic latitude        */
176     /* double *alpha;             (return) right ascension */
177     /* double *delta;             (return) declination     */
178
179     double sin_e, cos_e;
180     double sin_l, cos_l;
181
182     sin_e = sin(MeanObliquity);
183     cos_e = cos(MeanObliquity);
184     sin_l = sin(lambda);
185     cos_l = cos(lambda);
186
187     *alpha = atan2(sin_l*cos_e - tan(beta)*sin_e, cos_l);
188     *delta = asin(sin(beta)*cos_e + cos(beta)*sin_e*sin_l);
189 }
190
191
192 /* computing julian dates (assuming gregorian calendar, thus this is
193  * only valid for dates of 1582 oct 15 or later) (after duffett-smith,
194  * section 4) */
195
196 static double julian_date(int y, int m, int d) {
197     /* int y;                    year (e.g. 19xx)          */
198     /* int m;                    month (jan=1, feb=2, ...) */
199     /* int d;                    day of month              */
200
201     int    A, B, C, D;
202     double JD;
203
204     /* lazy test to ensure gregorian calendar */
205     if (y < 1583) {
206         FG_LOG( FG_EVENT, FG_ALERT, 
207                 "WHOOPS! Julian dates only valid for 1582 oct 15 or later" );
208     }
209
210     if ((m == 1) || (m == 2)) {
211         y -= 1;
212         m += 12;
213     }
214
215     A = y / 100;
216     B = 2 - A + (A / 4);
217     C = (int)(365.25 * y);
218     D = (int)(30.6001 * (m + 1));
219
220     JD = B + C + D + d + 1720994.5;
221
222     return JD;
223 }
224
225
226 /* compute greenwich mean sidereal time (GST) corresponding to a given
227  * number of seconds since the unix epoch (after duffett-smith,
228  * section 12) */
229 static double GST(time_t ssue) {
230     /* time_t ssue;           seconds since unix epoch */
231
232     double     JD;
233     double     T, T0;
234     double     UT;
235     struct tm *tm;
236
237     tm = gmtime(&ssue);
238
239     JD = julian_date(tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday);
240     T  = (JD - 2451545) / 36525;
241
242     T0 = ((T + 2.5862e-5) * T + 2400.051336) * T + 6.697374558;
243
244     T0 = fmod(T0, 24.0);
245     if (T0 < 0) T0 += 24;
246
247     UT = tm->tm_hour + (tm->tm_min + tm->tm_sec / 60.0) / 60.0;
248
249     T0 += UT * 1.002737909;
250     T0 = fmod(T0, 24.0);
251     if (T0 < 0) T0 += 24;
252
253     return T0;
254 }
255
256
257 /* given a particular time (expressed in seconds since the unix
258  * epoch), compute position on the earth (lat, lon) such that moon is
259  * directly overhead.  (lat, lon are reported in radians */
260
261 void fgMoonPosition(time_t ssue, double *lon, double *lat) {
262     /* time_t  ssue;           seconds since unix epoch */
263     /* double *lat;            (return) latitude        */
264     /* double *lon;            (return) longitude       */
265
266     /* double lambda; */
267     double alpha, delta;
268     double tmp;
269
270     /* lambda = moon_ecliptic_longitude(ssue); */
271     /* ecliptic_to_equatorial(lambda, 0.0, &alpha, &delta); */
272     //ecliptic_to_equatorial (solarPosition.lonMoon, 0.0, &alpha, &delta);
273     
274     /* ********************************************************************** 
275      * NOTE: in the next function, each time the moon's position is updated, the
276      * the moon's longitude is returned from solarSystem->moon. Note that the 
277      * moon's position is updated at a much higher frequency than the rate at 
278      * which the solar system's rebuilds occur. This is not a problem, however,
279      * because the fgMoonPosition we're talking about here concerns the changing
280      * position of the moon due to the daily rotation of the earth.
281      * The ecliptic longitude, however, represents the position of the moon with
282      * respect to the stars, and completes just one cycle over the course of a 
283      * year. Its therefore pretty safe to update the moon's longitude only once
284      * every ten minutes. (Comment added by Durk Talsma).
285      ************************************************************************/
286
287     ecliptic_to_equatorial( SolarSystem::theSolarSystem->getMoon()->getLon(),
288                             0.0, &alpha, &delta );
289     tmp = alpha - (FG_2PI/24)*GST(ssue);
290     if (tmp < -FG_PI) {
291         do tmp += FG_2PI;
292         while (tmp < -FG_PI);
293     } else if (tmp > FG_PI) {
294         do tmp -= FG_2PI;
295         while (tmp < -FG_PI);
296     }
297
298     *lon = tmp;
299     *lat = delta;
300 }
301
302
303 /* given a particular time expressed in side real time at prime
304  * meridian (GST), compute position on the earth (lat, lon) such that
305  * moon is directly overhead.  (lat, lon are reported in radians */
306
307 static void fgMoonPositionGST(double gst, double *lon, double *lat) {
308     /* time_t  ssue;           seconds since unix epoch */
309     /* double *lat;            (return) latitude        */
310     /* double *lon;            (return) longitude       */
311
312     /* double lambda; */
313     double alpha, delta;
314     double tmp;
315
316     /* lambda = moon_ecliptic_longitude(ssue); */
317     /* ecliptic_to_equatorial(lambda, 0.0, &alpha, &delta); */
318     //ecliptic_to_equatorial (solarPosition.lonMoon, 0.0, &alpha, &delta);
319     ecliptic_to_equatorial( SolarSystem::theSolarSystem->getMoon()->getLon(),
320                             SolarSystem::theSolarSystem->getMoon()->getLat(), 
321                             &alpha,  &delta );
322
323 //    tmp = alpha - (FG_2PI/24)*GST(ssue);
324     tmp = alpha - (FG_2PI/24)*gst;      
325     if (tmp < -FG_PI) {
326         do tmp += FG_2PI;
327         while (tmp < -FG_PI);
328     } else if (tmp > FG_PI) {
329         do tmp -= FG_2PI;
330         while (tmp < -FG_PI);
331     }
332
333     *lon = tmp;
334     *lat = delta;
335 }
336
337
338 // update the cur_time_params structure with the current moon position
339 void fgUpdateMoonPos( void ) {
340     fgLIGHT *l;
341     fgTIME *t;
342     FGView *v;
343     MAT3vec nup, nmoon, v0, surface_to_moon;
344     Point3D p, rel_moonpos;
345     double dot, east_dot;
346     double moon_gd_lat, sl_radius;
347     double ntmp;
348
349     l = &cur_light_params;
350     t = &cur_time_params;
351     v = &current_view;
352
353     FG_LOG( FG_EVENT, FG_INFO, "  Updating Moon position" );
354
355     // (not sure why there was two)
356     // fgMoonPosition(t->cur_time, &l->moon_lon, &moon_gd_lat);
357     fgMoonPositionGST(t->gst, &l->moon_lon, &moon_gd_lat);
358
359     fgGeodToGeoc(moon_gd_lat, 0.0, &sl_radius, &l->moon_gc_lat);
360
361     p = Point3D( l->moon_lon, l->moon_gc_lat, sl_radius );
362     l->fg_moonpos = fgPolarToCart3d(p);
363
364     FG_LOG( FG_EVENT, FG_INFO, "    t->cur_time = " << t->cur_time );
365     FG_LOG( FG_EVENT, FG_INFO, 
366             "    Moon Geodetic lat = " << moon_gd_lat
367             << " Geocentric lat = " << l->moon_gc_lat );
368
369     // I think this will work better for generating the moon light vector
370     l->moon_vec[0] = l->fg_moonpos.x();
371     l->moon_vec[1] = l->fg_moonpos.y();
372     l->moon_vec[2] = l->fg_moonpos.z();
373     MAT3_NORMALIZE_VEC(l->moon_vec, ntmp);
374     MAT3_SCALE_VEC(l->moon_vec_inv, l->moon_vec, -1.0);
375
376     // make sure these are directional light sources only
377     l->moon_vec[3] = 0.0;
378     l->moon_vec_inv[3] = 0.0;
379
380     // printf("  l->moon_vec = %.2f %.2f %.2f\n", l->moon_vec[0], l->moon_vec[1],
381     //        l->moon_vec[2]);
382
383     // calculate the moon's relative angle to local up
384     MAT3_COPY_VEC(nup, v->get_local_up());
385     nmoon[0] = l->fg_moonpos.x(); 
386     nmoon[1] = l->fg_moonpos.y();
387     nmoon[2] = l->fg_moonpos.z();
388     MAT3_NORMALIZE_VEC(nup, ntmp);
389     MAT3_NORMALIZE_VEC(nmoon, ntmp);
390
391     l->moon_angle = acos(MAT3_DOT_PRODUCT(nup, nmoon));
392     // printf("  MOON ANGLE relative to current location = %.3f rads.\n", 
393     //        l->moon_angle);
394     
395     // calculate vector to moon's position on the earth's surface
396     rel_moonpos = l->fg_moonpos - (v->get_view_pos() + scenery.center);
397     v->set_to_moon( rel_moonpos.x(), rel_moonpos.y(), rel_moonpos.z() );
398     // printf( "Vector to moon = %.2f %.2f %.2f\n",
399     //         v->to_moon[0], v->to_moon[1], v->to_moon[2]);
400
401     // make a vector to the current view position
402     Point3D view_pos = v->get_view_pos();
403     MAT3_SET_VEC(v0, view_pos.x(), view_pos.y(), view_pos.z());
404
405     // Given a vector from the view position to the point on the
406     // earth's surface the moon is directly over, map into onto the
407     // local plane representing "horizontal".
408     map_vec_onto_cur_surface_plane( v->get_local_up(), v0, v->get_to_moon(), 
409                                     surface_to_moon );
410     MAT3_NORMALIZE_VEC(surface_to_moon, ntmp);
411     v->set_surface_to_moon( surface_to_moon[0], surface_to_moon[1], 
412                            surface_to_moon[2] );
413     // printf("Surface direction to moon is %.2f %.2f %.2f\n",
414     //        v->surface_to_moon[0], v->surface_to_moon[1], v->surface_to_moon[2]);
415     // printf("Should be close to zero = %.2f\n", 
416     //        MAT3_DOT_PRODUCT(v->local_up, v->surface_to_moon));
417
418     // calculate the angle between v->surface_to_moon and
419     // v->surface_east.  We do this so we can sort out the acos()
420     // ambiguity.  I wish I could think of a more efficient way ... :-(
421     east_dot = MAT3_DOT_PRODUCT( surface_to_moon, v->get_surface_east() );
422     // printf("  East dot product = %.2f\n", east_dot);
423
424     // calculate the angle between v->surface_to_moon and
425     // v->surface_south.  this is how much we have to rotate the sky
426     // for it to align with the moon
427     dot = MAT3_DOT_PRODUCT( surface_to_moon, v->get_surface_south() );
428     // printf("  Dot product = %.2f\n", dot);
429     if ( east_dot >= 0 ) {
430         l->moon_rotation = acos(dot);
431     } else {
432         l->moon_rotation = -acos(dot);
433     }
434     // printf("  Sky needs to rotate = %.3f rads = %.1f degrees.\n", 
435     //        angle, angle * RAD_TO_DEG); */
436 }
437
438
439 // $Log$
440 // Revision 1.1  1999/04/05 21:32:47  curt
441 // Initial revision
442 //
443 // Revision 1.1  1999/03/22 12:08:57  curt
444 // Initial revision.
445 //
446 // Revision 1.19  1999/01/07 20:25:37  curt
447 // Portability changes and updates from Bernie Bright.
448 //
449 // Revision 1.18  1998/12/09 18:50:36  curt
450 // Converted "class fgVIEW" to "class FGView" and updated to make data
451 // members private and make required accessor functions.
452 //
453 // Revision 1.17  1998/11/09 23:41:53  curt
454 // Log message clean ups.
455 //
456 // Revision 1.16  1998/11/07 19:07:14  curt
457 // Enable release builds using the --without-logging option to the configure
458 // script.  Also a couple log message cleanups, plus some C to C++ comment
459 // conversion.
460 //
461 // Revision 1.15  1998/10/18 01:17:24  curt
462 // Point3D tweaks.
463 //
464 // Revision 1.14  1998/10/17 01:34:32  curt
465 // C++ ifying ...
466 //
467 // Revision 1.13  1998/10/16 00:56:12  curt
468 // Converted to Point3D class.
469 //
470 // Revision 1.12  1998/09/15 04:27:50  curt
471 // Changes for new astro code.
472 //
473 // Revision 1.11  1998/08/12 21:13:22  curt
474 // Optimizations by Norman Vine.
475 //
476 // Revision 1.10  1998/07/22 21:45:39  curt
477 // fg_time.cxx: Removed call to ctime() in a printf() which should be harmless
478 //   but seems to be triggering a bug.
479 // light.cxx: Added code to adjust fog color based on moonrise/moonset effects
480 //   and view orientation.  This is an attempt to match the fog color to the
481 //   sky color in the center of the screen.  You see discrepancies at the
482 //   edges, but what else can be done?
483 // moonpos.cxx: Caculate local direction to moon here.  (what compass direction
484 //   do we need to face to point directly at moon)
485 //
486 // Revision 1.9  1998/07/08 14:48:39  curt
487 // polar3d.h renamed to polar3d.hxx
488 //
489 // Revision 1.8  1998/05/02 01:53:18  curt
490 // Fine tuning mktime() support because of varying behavior on different
491 // platforms.
492 //
493 // Revision 1.7  1998/04/30 12:36:05  curt
494 // C++-ifying a couple source files.
495 //
496 // Revision 1.6  1998/04/28 01:22:18  curt
497 // Type-ified fgTIME and fgVIEW.
498 //
499 // Revision 1.5  1998/04/26 05:10:05  curt
500 // "struct fgLIGHT" -> "fgLIGHT" because fgLIGHT is typedef'd.
501 //
502 // Revision 1.4  1998/04/25 22:06:34  curt
503 // Edited cvs log messages in source files ... bad bad bad!
504 //
505 // Revision 1.3  1998/04/25 20:24:03  curt
506 // Cleaned up initialization sequence to eliminate interdependencies
507 // between moon position, lighting, and view position.  This creates a
508 // valid single pass initialization path.
509 //
510 // Revision 1.2  1998/04/24 00:52:31  curt
511 // Wrapped "#include <config.h>" in "#ifdef HAVE_CONFIG_H"
512 // Fog color fixes.
513 // Separated out lighting calcs into their own file.
514 //
515 // Revision 1.1  1998/04/22 13:24:07  curt
516 // C++ - ifiing the code a bit.
517 // Starting to reorginize some of the lighting calcs to use a table lookup.
518 //
519 // Revision 1.27  1998/04/03 22:12:57  curt
520 // Converting to Gnu autoconf system.
521 // Centralized time handling differences.
522 //
523 // Revision 1.26  1998/02/23 19:08:00  curt
524 // Incorporated Durk's Astro/ tweaks.  Includes unifying the moon position
525 // calculation code between moon display, and other FG sections that use this
526 // for things like lighting.
527 //
528 // Revision 1.25  1998/02/09 15:07:53  curt
529 // Minor tweaks.
530 //
531 // Revision 1.24  1998/01/27 00:48:07  curt
532 // Incorporated Paul Bleisch's <pbleisch@acm.org> new debug message
533 // system and commandline/config file processing code.
534 //
535 // Revision 1.23  1998/01/19 19:27:21  curt
536 // Merged in make system changes from Bob Kuehne <rpk@sgi.com>
537 // This should simplify things tremendously.
538 //
539 // Revision 1.22  1998/01/19 18:40:40  curt
540 // Tons of little changes to clean up the code and to remove fatal errors
541 // when building with the c++ compiler.
542 //
543 // Revision 1.21  1997/12/30 23:10:19  curt
544 // Calculate lighting parameters here.
545 //
546 // Revision 1.20  1997/12/30 22:22:43  curt
547 // Further integration of event manager.
548 //
549 // Revision 1.19  1997/12/30 20:47:59  curt
550 // Integrated new event manager with subsystem initializations.
551 //
552 // Revision 1.18  1997/12/23 04:58:40  curt
553 // Tweaked the sky coloring a bit to build in structures to allow finer rgb
554 // control.
555 //
556 // Revision 1.17  1997/12/15 23:55:08  curt
557 // Add xgl wrappers for debugging.
558 // Generate terrain normals on the fly.
559 //
560 // Revision 1.16  1997/12/11 04:43:57  curt
561 // Fixed moon vector and lighting problems.  I thing the moon is now lit
562 // correctly.
563 //
564 // Revision 1.15  1997/12/10 22:37:55  curt
565 // Prepended "fg" on the name of all global structures that didn't have it yet.
566 // i.e. "struct WEATHER {}" became "struct fgWEATHER {}"
567 //
568 // Revision 1.14  1997/12/09 04:25:39  curt
569 // Working on adding a global lighting params structure.
570 //
571 // Revision 1.13  1997/11/25 19:25:42  curt
572 // Changes to integrate Durk's moon/moon code updates + clean up.
573 //
574 // Revision 1.12  1997/11/15 18:15:39  curt
575 // Reverse direction of moon vector, so object normals can be more normal.
576 //
577 // Revision 1.11  1997/10/28 21:07:21  curt
578 // Changed GLUT/ -> Main/
579 //
580 // Revision 1.10  1997/09/13 02:00:09  curt
581 // Mostly working on stars and generating sidereal time for accurate star
582 // placement.
583 //
584 // Revision 1.9  1997/09/05 14:17:31  curt
585 // More tweaking with stars.
586 //
587 // Revision 1.8  1997/09/05 01:36:04  curt
588 // Working on getting stars right.
589 //
590 // Revision 1.7  1997/09/04 02:17:40  curt
591 // Shufflin' stuff.
592 //
593 // Revision 1.6  1997/08/27 03:30:37  curt
594 // Changed naming scheme of basic shared structures.
595 //
596 // Revision 1.5  1997/08/22 21:34:41  curt
597 // Doing a bit of reorganizing and house cleaning.
598 //
599 // Revision 1.4  1997/08/19 23:55:09  curt
600 // Worked on better simulating real lighting.
601 //
602 // Revision 1.3  1997/08/13 20:23:49  curt
603 // The interface to moonpos now updates a global structure rather than returning
604 // current moon position.
605 //
606 // Revision 1.2  1997/08/06 00:24:32  curt
607 // Working on correct real time moon lighting.
608 //
609 // Revision 1.1  1997/08/01 15:27:56  curt
610 // Initial revision.
611 //