summaryrefslogtreecommitdiff
path: root/core/settings/citytime/sun.h
Unidiff
Diffstat (limited to 'core/settings/citytime/sun.h') (more/less context) (ignore whitespace changes)
-rw-r--r--core/settings/citytime/sun.h57
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
49extern "C" {
50#endif
51double jtime(struct tm *t);
52double kepler(double m, double ecc);
53void sunpos(double jd, int apparent, double *ra, double *dec, double *rv, double *slong);
54void projillum(short *wtab, int xdots, int ydots, double dec);
55#ifdef __cplusplus
56};
57#endif