]> git.mxchange.org Git - flightgear.git/blob - src/Time/sunsolver.hxx
Expose the time of day setting through the fg_command and property interface
[flightgear.git] / src / Time / sunsolver.hxx
1 /*
2  * sunsolver.hxx - given a location on earth and a time of day/date,
3  *                 find the number of seconds to various sun positions.
4  *
5  * Written by Curtis Olson, started September 2003.
6  *
7  * Copyright (C) 2003  Curtis L. Olson  - curt@flightgear.org
8  *
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.
13  *
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.
18  *
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., 675 Mass Ave, Cambridge, MA 02139, USA.
22  *
23  * $Id$
24  */
25
26
27 #ifndef _SUNSOLVER_HXX
28 #define _SUNSOLVER_HXX
29
30
31 #ifndef __cplusplus                                                          
32 # error This library requires C++
33 #endif                                   
34
35 #include <simgear/compiler.h>
36
37 #ifdef SG_HAVE_STD_INCLUDES
38 #  include <ctime>
39 #else
40 #  include <time.h>
41 #endif
42
43 /**
44  * Given the current unix time in seconds, calculate seconds to
45  * highest sun angle.
46  */
47 time_t fgTimeSecondsUntilNoon( time_t cur_time,
48                                double lon_rad,
49                                double lat_rad );
50
51
52 /**
53  * Given the current unix time in seconds, calculate seconds to lowest
54  * sun angle.
55  */
56 time_t fgTimeSecondsUntilMidnight( time_t cur_time,
57                                    double lon_rad,
58                                    double lat_rad );
59
60 /**
61  * Given the current unix time in seconds, calculate seconds to dusk
62  */
63 time_t fgTimeSecondsUntilDusk( time_t cur_time,
64                                double lon_rad,
65                                double lat_rad );
66
67
68 /**
69  * Given the current unix time in seconds, calculate seconds to dawn
70  */
71 time_t fgTimeSecondsUntilDawn( time_t cur_time,
72                                double lon_rad,
73                                double lat_rad );
74
75
76
77 #endif /* _SUNSOLVER_HXX */