From ae2a03c2941bf92573f89b88ef73f8aa842bea0a Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdetoys@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kworldwatch/sunclock.h | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 kworldwatch/sunclock.h (limited to 'kworldwatch/sunclock.h') diff --git a/kworldwatch/sunclock.h b/kworldwatch/sunclock.h new file mode 100644 index 0000000..1787506 --- /dev/null +++ b/kworldwatch/sunclock.h @@ -0,0 +1,98 @@ +/* + * Sun clock. X11 version by John Mackin. + * + * This program was derived from, and is still in part identical with, the + * Suntools Sun clock program whose author's comment appears immediately + * below. Please preserve both notices. + * + * The X11R3/4 version of this program was written by John Mackin, at the + * Basser Department of Computer Science, University of Sydney, Sydney, + * New South Wales, Australia; . This program, like + * the one it was derived from, is in the public domain: `Love is the + * law, love under will.' + */ + +/* + + Sun clock + + Designed and implemented by John Walker in November of 1988. + + Version for the Sun Workstation. + + The algorithm used to calculate the position of the Sun is given in + Chapter 18 of: + + "Astronomical Formulae for Calculators" by Jean Meeus, Third Edition, + Richmond: Willmann-Bell, 1985. This book can be obtained from: + + Willmann-Bell + P.O. Box 35025 + Richmond, VA 23235 + USA + Phone: (804) 320-7016 + + This program was written by: + + John Walker + Autodesk, Inc. + 2320 Marinship Way + Sausalito, CA 94965 + USA + Fax: (415) 389-9418 + Voice: (415) 332-2344 Ext. 2829 + Usenet: {sun,well,uunet}!acad!kelvin + or: kelvin@acad.uu.net + + modified for interactive maps by + + Stephen Martin + Fujitsu Systems Business of Canada + smartin@fujitsu.ca + + This program is in the public domain: "Do what thou wilt shall be the + whole of the law". I'd appreciate receiving any bug fixes and/or + enhancements, which I'll incorporate in future versions of the + program. Please leave the original attribution information intact so + that credit and blame may be properly apportioned. + + Revision history: + + 1.0 12/21/89 Initial version. + 8/24/89 Finally got around to submitting. + + 1.1 8/31/94 Version with interactive map. + 1.2 10/12/94 Fixes for HP and Solaris, new icon bitmap + 1.3 11/01/94 Timezone now shown in icon + 1.4 03/29/98 Fixed city drawing, added icon animation + +*/ + +#ifndef SUNCLOCK_H +#define SUNCLOCK_H + +#include +#include +#include +#include + +#ifndef PI +#define PI 3.14159265358979323846 +#endif + +#ifndef E +#define E 2.7182818284590452354 +#endif + +#define abs(x) ((x) < 0 ? (-(x)) : x) /* Absolute value */ +#define sgn(x) (((x) < 0) ? -1 : ((x) > 0 ? 1 : 0)) /* Extract sign */ +#define dtr(x) ((x) * (PI / 180.0)) /* Degree->Radian */ +#define rtd(x) ((x) / (PI / 180.0)) /* Radian->Degree */ +#define fixangle(a) ((a) - 360.0 * (floor((a) / 360.0))) /* Fix angle */ + +#define TERMINC 100 /* Circle segments for terminator */ + +#define PROJINT (60 * 10) /* Frequency of seasonal recalculation */ + +#endif + -- cgit v1.2.1