2 * sunsolver.hxx - given a location on earth and a time of day/date,
3 * find the number of seconds to various sun positions.
5 * Written by Curtis Olson, started September 2003.
7 * Copyright (C) 2003 Curtis L. Olson - http://www.flightgear.org/~curt
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of the
12 * License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
27 #ifndef _SUNSOLVER_HXX
28 #define _SUNSOLVER_HXX
32 # error This library requires C++
35 #include <simgear/compiler.h>
40 * Given the current unix time in seconds, calculate seconds to the
41 * specified sun angle (relative to straight up.) Also specify if we
42 * want the angle while the sun is ascending or descending. For
43 * instance noon is when the sun angle is 0 (or the closest it can
44 * get.) Dusk is when the sun angle is 90 and descending. Dawn is
45 * when the sun angle is 90 and ascending.
47 time_t fgTimeSecondsUntilSunAngle( time_t cur_time,
50 double target_angle_deg,
54 * given a particular time expressed in side real time at prime
55 * meridian (GST), compute position on the earth (lat, lon) such that
56 * sun is directly overhead. (lat, lon are reported in radians
58 void fgSunPositionGST(double gst, double *lon, double *lat);
60 #endif /* _SUNSOLVER_HXX */