~ubuntu-branches/debian/squeeze/stellarium/squeeze

« back to all changes in this revision

Viewing changes to src/stellastro/stellastro.h

  • Committer: Bazaar Package Importer
  • Author(s): Cédric Delfosse
  • Date: 2008-05-19 21:28:23 UTC
  • mfrom: (3.1.5 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080519212823-m5nfiuntxstxzxj7
Tags: 0.9.1-4
Add libxcursor-dev, libxfixes-dev, libxinerama-dev, libqt4-opengl-dev to
build-deps (Closes: #479906)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
Copyright (C) 2000 Liam Girdwood <liam@nova-ioe.org>
3
 
Copyright (C) 2003 Fabien Ch�reau
4
 
 
5
 
This program is free software; you can redistribute it and/or modify
6
 
it under the terms of the GNU Library General Public License as published by
7
 
the Free Software Foundation; either version 2 of the License, or
8
 
(at your option) any later version.
9
 
 
10
 
This program is distributed in the hope that it will be useful,
11
 
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 
GNU General Public License for more details.
14
 
 
15
 
You should have received a copy of the GNU General Public License
16
 
along with this program; if not, write to the Free Software
17
 
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18
 
*/
19
 
 
20
 
#ifndef _STELLASTRO_H
21
 
#define _STELLASTRO_H
22
 
 
23
 
#ifdef __cplusplus
24
 
extern "C" {
25
 
#endif
26
 
 
27
 
#include <time.h>
28
 
 
29
 
#ifndef J2000
30
 
# define J2000 2451545.0
31
 
#endif
32
 
 
33
 
// General Calendar Functions
34
 
 
35
 
// Human readable (easy printf) date format
36
 
typedef struct
37
 
{
38
 
    int years;          /*!< Years. All values are valid */
39
 
    int months;         /*!< Months. Valid values : 1 (January) - 12 (December) */
40
 
    int days;           /*!< Days. Valid values 1 - 28,29,30,31 Depends on month.*/
41
 
    int hours;          /*!< Hours. Valid values 0 - 23. */
42
 
    int minutes;        /*!< Minutes. Valid values 0 - 59. */
43
 
    double seconds;     /*!< Seconds. Valid values 0 - 59.99999.... */
44
 
}ln_date;
45
 
 
46
 
 
47
 
/* Calculate the julian day from date.*/
48
 
double get_julian_day(const ln_date * date);
49
 
 
50
 
/* Calculate the date from the julian day. */
51
 
void get_date(double JD, ln_date * date);
52
 
 
53
 
/* Calculate day of the week. 0 = Sunday .. 6 = Saturday */
54
 
unsigned int get_day_of_week (const ln_date *date);
55
 
        
56
 
/* Calculate julian day from system time. */
57
 
double get_julian_from_sys();
58
 
 
59
 
/* Calculate gmt date from system date */
60
 
void get_ln_date_from_sys(ln_date * date);
61
 
 
62
 
// Obtains a ln_date from 2 strings s1 and s2 for date and time
63
 
// with the form dd/mm/yyyy for s1 and hh:mm:ss.s for s2.
64
 
// Returns NULL if s1 or s2 is not valid.
65
 
// Uses the current date if s1 is "today" and current time if s2 is "now"
66
 
const ln_date * str_to_date(const char * s1, const char * s2);
67
 
 
68
 
// Calculate tm struct from julian day
69
 
void get_tm_from_julian(double JD, struct tm * tm_time);
70
 
 
71
 
// Calculate time_t from julian day
72
 
time_t get_time_t_from_julian(double JD);
73
 
 
74
 
// Return the number of hours to add to gmt time to get the local time
75
 
// taking the parameters from system. This takes into account the daylight saving
76
 
// time if there is.
77
 
int get_gmt_shift_from_system(void);
78
 
 
79
 
/* puts a large angle in the correct range 0 - 360 degrees */
80
 
double range_degrees (double angle);
81
 
 
82
 
/* puts a large angle in the correct range 0 - 2PI radians */
83
 
double range_radians (double angle);
84
 
 
85
 
 
86
 
/* Calculate mean sidereal time from date. */
87
 
double get_mean_sidereal_time (double JD);
88
 
 
89
 
/* Calculate apparent sidereal time from date.*/
90
 
double get_apparent_sidereal_time (double JD);
91
 
 
92
 
/* Input t is time in julian days.
93
 
 * Valid range is the years -8000 to +12000 (t = -100 to 100).
94
 
 * return mean obliquity (epsilon sub 0) in degrees.*/
95
 
double get_mean_obliquity( double t );
96
 
 
97
 
/* Calculate Earth globe centre distance. */
98
 
void get_earth_centre_dist (float height, double latitude, double * p_sin_o, double * p_cos_o);
99
 
 
100
 
 
101
 
/* Calculate the adjustment in altitude of a body due to atmospheric refraction. */
102
 
double get_refraction_adj (double altitude, double atm_pres, double temp);
103
 
 
104
 
 
105
 
#ifdef __cplusplus
106
 
};
107
 
#endif
108
 
 
109
 
 
110
 
#endif /* _STELLASTRO_H */