*
* Written by Curtis Olson, started September 2003.
*
- * Copyright (C) 2003 Curtis L. Olson - curt@flightgear.org
+ * Copyright (C) 2003 Curtis L. Olson - http://www.flightgear.org/~curt
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* $Id$
*/
#include <simgear/compiler.h>
-#ifdef SG_HAVE_STD_INCLUDES
-# include <ctime>
-#else
-# include <time.h>
-#endif
+#include <ctime>
/**
- * Given the current unix time in seconds, calculate seconds to
- * highest sun angle.
+ * Given the current unix time in seconds, calculate seconds to the
+ * specified sun angle (relative to straight up.) Also specify if we
+ * want the angle while the sun is ascending or descending. For
+ * instance noon is when the sun angle is 0 (or the closest it can
+ * get.) Dusk is when the sun angle is 90 and descending. Dawn is
+ * when the sun angle is 90 and ascending.
*/
-time_t fgTimeSecondsUntilNoon( time_t cur_time,
- double lon_rad,
- double lat_rad );
-
-
-/**
- * Given the current unix time in seconds, calculate seconds to lowest
- * sun angle.
- */
-time_t fgTimeSecondsUntilMidnight( time_t cur_time,
+time_t fgTimeSecondsUntilSunAngle( time_t cur_time,
double lon_rad,
- double lat_rad );
-
-/**
- * Given the current unix time in seconds, calculate seconds to dusk
- */
-time_t fgTimeSecondsUntilDusk( time_t cur_time,
- double lon_rad,
- double lat_rad );
-
+ double lat_rad,
+ double target_angle_deg,
+ bool ascending );
/**
- * Given the current unix time in seconds, calculate seconds to dawn
+ * given a particular time expressed in side real time at prime
+ * meridian (GST), compute position on the earth (lat, lon) such that
+ * sun is directly overhead. (lat, lon are reported in radians
*/
-time_t fgTimeSecondsUntilDawn( time_t cur_time,
- double lon_rad,
- double lat_rad );
-
-
+void fgSunPositionGST(double gst, double *lon, double *lat);
#endif /* _SUNSOLVER_HXX */