• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

marble

  • sources
  • kde-4.14
  • kdeedu
  • marble
  • src
  • lib
  • astro
astrolib.h
Go to the documentation of this file.
1 //
2 // This file is part of the Marble Virtual Globe.
3 //
4 // This program is free software licensed under the GNU LGPL. You can
5 // find a copy of this license in LICENSE.txt in the top directory of
6 // the source code.
7 //
8 // Copyright 2013 Gerhard Holtkamp
9 //
10 
11 #if !defined(__astrolib_h)
12 #define __astrolib_h
13 
14 #include "attlib.h"
15 #include "astrolib_export.h"
16 
17 /***********************************************************************
18  Definitions of Astrolib Functions
19 
20 
21  License: GNU LGPL Version 2+
22 
23  Author: Gerhard HOLTKAMP 14-JAN-2012
24  ***********************************************************************/
25 
26 ASTROLIB_EXPORT double ddd (int d, int m, double s); // deg, min, sec -> decimal degrees
27 ASTROLIB_EXPORT void dms (double dd, int &d, int &m, double &s); // dec deg -> deg, min, sec
28 ASTROLIB_EXPORT double mjd (int day, int month, int year, double hour); // modified Julian date
29 ASTROLIB_EXPORT double julcent (double mjuld); // Julian centuries since 2000.0
30 ASTROLIB_EXPORT void caldat (double mjd, int &day, int &month, int &year, double &hour);
31 ASTROLIB_EXPORT double DefTdUt (int yr); // default value for TDT - UT in seconds
32 ASTROLIB_EXPORT double lsidtim (double jd, double lambda, double ep2); // Sidereal Time
33 
34 ASTROLIB_EXPORT double eps (double t); // obliquity of ecliptic
35 ASTROLIB_EXPORT Vec3 eclequ (double t, Vec3& r1); // ecliptic -> equatorial
36 ASTROLIB_EXPORT Vec3 equecl (double t, Vec3& r1); // equatorial -> ecliptic
37 ASTROLIB_EXPORT Mat3 pmatecl (double t1, double t2); // ecl. precession
38 ASTROLIB_EXPORT Mat3 pmatequ (double t1, double t2); // equ. precession
39 ASTROLIB_EXPORT Mat3 nutmat (double t, double& ep2, bool hipr = false); // nutation (equatorial)
40 ASTROLIB_EXPORT Mat3 nutecl (double t, double& ep2); // nutation matrix (ecliptic)
41 ASTROLIB_EXPORT Mat3 PoleMx (double xp, double yp); // Polar motion matrix
42 ASTROLIB_EXPORT Vec3 aberrat (double t, Vec3& ve); // aberration
43 
44 ASTROLIB_EXPORT Vec3 GeoPos (double jd, double ep2, double lat, double lng, double ht);
45 ASTROLIB_EXPORT Vec3 GeoPos (double jd, double ep2, double lat, double lng, double ht,
46  double xp, double yp);
47 ASTROLIB_EXPORT Vec3 EquHor (double jd, double ep2, double lat, double lng, Vec3 r);
48 ASTROLIB_EXPORT Vec3 HorEqu (double jd, double ep2, double lat, double lng, Vec3 r);
49 ASTROLIB_EXPORT void AppPos (double jd, double ep2, double lat, double lng, double ht,
50  int solsys, Vec3 r, double& azim, double& elev, double& dist);
51 ASTROLIB_EXPORT void AppRADec (double jd, double ep2, double lat, double lng,
52  double azim, double elev, double& ra, double& dec);
53 ASTROLIB_EXPORT double Refract (double h, double p = 1015.0, double t = 15.0); // refraction
54 
55 ASTROLIB_EXPORT double eccanom (double man, double ecc); // eccentric anomaly
56 ASTROLIB_EXPORT double hypanom (double mh, double ecc); // hyperbolic anomaly
57 ASTROLIB_EXPORT void ellip (double gm, double t0, double t, double a, double ecc,
58  double m0, Vec3& r1, Vec3& v1); // elliptic state vector
59 ASTROLIB_EXPORT void hyperb (double gm, double t0, double t, double a, double ecc,
60  Vec3& r1, Vec3& v1); // hyperbolic state vector
61 ASTROLIB_EXPORT void parab (double gm, double t0, double t, double q, double ecc,
62  Vec3& r1, Vec3& v1); // elliptic state vector
63 ASTROLIB_EXPORT void kepler (double gm, double t0, double t, double m0, double a, double ecc,
64  double ran, double aper, double inc, Vec3& r1, Vec3& v1);
65 ASTROLIB_EXPORT void oscelm (double gm, double t, Vec3& r1, Vec3& v1,
66  double& t0, double& m0, double& a, double& ecc,
67  double& ran, double& aper, double& inc);
68 
69 ASTROLIB_EXPORT Vec3 QuickSun (double t); // low precision position of the Sun at time t
70 
71 class ASTROLIB_EXPORT Sun200 // Calculating the Sun in epoch J2000.0 coordinates
72  {
73  public:
74  Sun200();
75  Vec3 position (double t); // position of the Sun
76  void state (double t, Vec3& rs, Vec3& vs); // State vector of the Sun
77 
78  private:
79  double c3[9], s3[9];
80  double c[9], s[9];
81  double m2, m3, m4, m5, m6;
82  double d, a, uu, tt;
83  double cl, sl, cb, sb;
84  double u, v, dl, dr, db;
85  static void addthe (double c1, double s1, double c2, double s2,
86  double& cc, double& ss);
87  void term (int i1, int i, int it, double dlc, double dls, double drc,
88  double drs, double dbc, double dbs);
89  void pertven();
90  void pertmar();
91  void pertjup();
92  void pertsat();
93  void pertmoo();
94  };
95 
96 class ASTROLIB_EXPORT Moon200 // Calculating the position of the Moon in J2000.0
97  {
98  public:
99  Moon200();
100  Vec3 position (double t); // position of the Moon
101 
102  private:
103  double dgam, dlam, n, gam1c, sinpi;
104  double l0, l, ls, f, d, s;
105  double dl0, dl, dls, df, dd, ds;
106  double co[13][4];
107  double si[13][4];
108  static void addthe (double c1, double s1, double c2, double s2,
109  double& c, double& s);
110  static double sinus (double phi);
111  void long_periodic (double t);
112  void minit(double t);
113  void term (int p, int q, int r, int s, double& x, double& y) const;
114  void addsol(double coeffl, double coeffs, double coeffg,
115  double coeffp, int p, int q, int r, int s);
116  void solar1();
117  void solar2();
118  void solar3();
119  void addn (double coeffn, int p, int q, int r, int s,
120  double& n, double&x, double& y) const;
121  void solarn (double& n) const;
122  void planetary (double t);
123  };
124 
125 class ASTROLIB_EXPORT Eclipse // Eclipse Calculations
126  {
127  public:
128  Eclipse();
129  int solar (double jd, double tdut, double& phi, double& lamda);
130  void maxpos (double jd, double tdut, double& phi, double& lamda);
131  void penumd (double jd, double tdut, Vec3& vrm, Vec3& ves,
132  double& dpn, double& pang);
133  void umbra (double jd, double tdut, Vec3& vrm, Vec3& ves,
134  double& dpn, double& pang);
135  double duration (double jd, double tdut, double& width);
136  Vec3 GetRSun () const; // get Earth - Sun vector in Earth radii
137  Vec3 GetRMoon () const; // get Earth - Moon vector in Earth radii
138  double GetEp2 () const; // get the ep2 value
139  int lunar (double jd, double tdut);
140 
141  private:
142  Sun200 sun;
143  Moon200 moon;
144  Vec3 rs, rm; // position of the Sun and the Moon
145  Vec3 eshadow; // unit vector in direction of shadow
146  Vec3 rint; // intersection shadow axis - Earth surface
147  double t; // time in Julian Centuries
148  double ep2; // correction for Apparent Sideral Time
149  double d_umbra; // diameter of umbra in Earth Radii
150  double d_penumbra; // diameter of penumbra in Earth Radii
151  void equ_sun_moon(double jd, double tdut);
152  };
153 
154 #endif // __astrolib_h sentry.
155 
156 
Mat3
Definition: attlib.h:63
ddd
ASTROLIB_EXPORT double ddd(int d, int m, double s)
Definition: astrolib.cpp:35
nutmat
ASTROLIB_EXPORT Mat3 nutmat(double t, double &ep2, bool hipr=false)
Definition: astrolib.cpp:437
Vec3
Definition: attlib.h:27
Moon200
Definition: astrolib.h:96
EquHor
ASTROLIB_EXPORT Vec3 EquHor(double jd, double ep2, double lat, double lng, Vec3 r)
Definition: astrolib.cpp:790
eccanom
ASTROLIB_EXPORT double eccanom(double man, double ecc)
Definition: astrolib.cpp:915
ASTROLIB_EXPORT
#define ASTROLIB_EXPORT
Definition: astrolib_export.h:20
attlib.h
Eclipse
Definition: astrolib.h:125
equecl
ASTROLIB_EXPORT Vec3 equecl(double t, Vec3 &r1)
Definition: astrolib.cpp:358
julcent
ASTROLIB_EXPORT double julcent(double mjuld)
Definition: astrolib.cpp:135
AppPos
ASTROLIB_EXPORT void AppPos(double jd, double ep2, double lat, double lng, double ht, int solsys, Vec3 r, double &azim, double &elev, double &dist)
Definition: astrolib.cpp:835
eps
ASTROLIB_EXPORT double eps(double t)
Definition: astrolib.cpp:325
PoleMx
ASTROLIB_EXPORT Mat3 PoleMx(double xp, double yp)
Definition: astrolib.cpp:675
DefTdUt
ASTROLIB_EXPORT double DefTdUt(int yr)
Definition: astrolib.cpp:223
Sun200
Definition: astrolib.h:71
ellip
ASTROLIB_EXPORT void ellip(double gm, double t0, double t, double a, double ecc, double m0, Vec3 &r1, Vec3 &v1)
Definition: astrolib.cpp:982
pmatecl
ASTROLIB_EXPORT Mat3 pmatecl(double t1, double t2)
Definition: astrolib.cpp:375
mjd
ASTROLIB_EXPORT double mjd(int day, int month, int year, double hour)
Definition: astrolib.cpp:94
hyperb
ASTROLIB_EXPORT void hyperb(double gm, double t0, double t, double a, double ecc, Vec3 &r1, Vec3 &v1)
Definition: astrolib.cpp:1013
eclequ
ASTROLIB_EXPORT Vec3 eclequ(double t, Vec3 &r1)
Definition: astrolib.cpp:341
GeoPos
ASTROLIB_EXPORT Vec3 GeoPos(double jd, double ep2, double lat, double lng, double ht)
Definition: astrolib.cpp:718
caldat
ASTROLIB_EXPORT void caldat(double mjd, int &day, int &month, int &year, double &hour)
Definition: astrolib.cpp:145
parab
ASTROLIB_EXPORT void parab(double gm, double t0, double t, double q, double ecc, Vec3 &r1, Vec3 &v1)
Definition: astrolib.cpp:1064
nutecl
ASTROLIB_EXPORT Mat3 nutecl(double t, double &ep2)
Definition: astrolib.cpp:637
kepler
ASTROLIB_EXPORT void kepler(double gm, double t0, double t, double m0, double a, double ecc, double ran, double aper, double inc, Vec3 &r1, Vec3 &v1)
Definition: astrolib.cpp:1134
astrolib_export.h
HorEqu
ASTROLIB_EXPORT Vec3 HorEqu(double jd, double ep2, double lat, double lng, Vec3 r)
Definition: astrolib.cpp:813
Refract
ASTROLIB_EXPORT double Refract(double h, double p=1015.0, double t=15.0)
Definition: astrolib.cpp:893
dms
ASTROLIB_EXPORT void dms(double dd, int &d, int &m, double &s)
Definition: astrolib.cpp:59
AppRADec
ASTROLIB_EXPORT void AppRADec(double jd, double ep2, double lat, double lng, double azim, double elev, double &ra, double &dec)
Definition: astrolib.cpp:867
lsidtim
ASTROLIB_EXPORT double lsidtim(double jd, double lambda, double ep2)
Definition: astrolib.cpp:302
QuickSun
ASTROLIB_EXPORT Vec3 QuickSun(double t)
Definition: astrolib.cpp:1359
oscelm
ASTROLIB_EXPORT void oscelm(double gm, double t, Vec3 &r1, Vec3 &v1, double &t0, double &m0, double &a, double &ecc, double &ran, double &aper, double &inc)
Definition: astrolib.cpp:1220
pmatequ
ASTROLIB_EXPORT Mat3 pmatequ(double t1, double t2)
Definition: astrolib.cpp:408
aberrat
ASTROLIB_EXPORT Vec3 aberrat(double t, Vec3 &ve)
Definition: astrolib.cpp:695
hypanom
ASTROLIB_EXPORT double hypanom(double mh, double ecc)
Definition: astrolib.cpp:951
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:38 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

marble

Skip menu "marble"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal