author | kergoth <kergoth> | 2002-01-25 22:14:26 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2002-01-25 22:14:26 (UTC) |
commit | 15318cad33835e4e2dc620d033e43cd930676cdd (patch) (unidiff) | |
tree | c2fa0399a2c47fda8e2cd0092c73a809d17f68eb /core/settings/citytime/sun.h | |
download | opie-15318cad33835e4e2dc620d033e43cd930676cdd.zip opie-15318cad33835e4e2dc620d033e43cd930676cdd.tar.gz opie-15318cad33835e4e2dc620d033e43cd930676cdd.tar.bz2 |
Initial revision
Diffstat (limited to 'core/settings/citytime/sun.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/settings/citytime/sun.h | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/core/settings/citytime/sun.h b/core/settings/citytime/sun.h new file mode 100644 index 0000000..2091621 --- a/dev/null +++ b/core/settings/citytime/sun.h | |||
@@ -0,0 +1,57 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | ||
3 | ** | ||
4 | ** This file is part of Qtopia Environment. | ||
5 | ** | ||
6 | ** This file may be distributed and/or modified under the terms of the | ||
7 | ** GNU General Public License version 2 as published by the Free Software | ||
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
9 | ** packaging of this file. | ||
10 | ** | ||
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | ||
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
13 | ** | ||
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | ||
15 | ** | ||
16 | ** Contact info@trolltech.com if any conditions of this licensing are | ||
17 | ** not clear to you. | ||
18 | ** | ||
19 | **********************************************************************/ | ||
20 | /* | ||
21 | * Sun clock definitions. | ||
22 | */ | ||
23 | |||
24 | #include <stdio.h> | ||
25 | #include <stdlib.h> | ||
26 | #include <math.h> | ||
27 | #include <time.h> | ||
28 | |||
29 | #ifndef PI | ||
30 | #define PI 3.14159265358979323846 | ||
31 | #endif | ||
32 | |||
33 | #ifndef E | ||
34 | #define E 2.7182818284590452354 | ||
35 | #endif | ||
36 | |||
37 | #define abs(x) ((x) < 0 ? (-(x)) : x) /* Absolute value */ | ||
38 | #define sgn(x) (((x) < 0) ? -1 : ((x) > 0 ? 1 : 0)) /* Extract sign */ | ||
39 | #define dtr(x) ((x) * (PI / 180.0)) /* Degree->Radian */ | ||
40 | #define rtd(x) ((x) / (PI / 180.0)) /* Radian->Degree */ | ||
41 | #define fixangle(a) ((a) - 360.0 * (qFloor((a) / 360.0))) /* Fix angle */ | ||
42 | |||
43 | #define TERMINC 100 /* Circle segments for terminator */ | ||
44 | |||
45 | #define PROJINT (60 * 10) /* Frequency of seasonal recalculation */ | ||
46 | |||
47 | |||
48 | #ifdef __cplusplus | ||
49 | extern "C" { | ||
50 | #endif | ||
51 | double jtime(struct tm *t); | ||
52 | double kepler(double m, double ecc); | ||
53 | void sunpos(double jd, int apparent, double *ra, double *dec, double *rv, double *slong); | ||
54 | void projillum(short *wtab, int xdots, int ydots, double dec); | ||
55 | #ifdef __cplusplus | ||
56 | }; | ||
57 | #endif | ||