ksnumbers.h 4.03 KB
Newer Older
Chris Howells's avatar
adding  
Chris Howells committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
/***************************************************************************
                          ksnumbers.h  -  description
                             -------------------
    begin                : Sun Jan 13 2002
    copyright            : (C) 2002 by Jason Harris
    email                : kstars@30doradus.org
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef KSNUMBERS_H
#define KSNUMBERS_H

#include "dms.h"

23 24 25 26 27 28 29 30 31 32 33 34 35
/**There are several time-dependent values used in position calculations,
	*that are not specific to an object.  This class provides
	*storage for these values, and methods for calculating them for a given date.
	*The numbers include solar data like the true/mean solar anomalies
	*and longitudes, the longitude of the Earth's perihelion, the
	*eccentricity of Earth's orbit, the
	*constant of aberration, the obliquity of the Ecliptic, the effects of
	*Nutation (delta Obliquity and delta Ecliptic longitude),
	*the Julian Day/Century/Millenium, and arrays for computing the precession.
	*@short Numbers used in a variety of position calculations.
	*@author Jason Harris
	*@version 0.9
	*/
Chris Howells's avatar
adding  
Chris Howells committed
36 37 38

class KSNumbers {
public: 
39
	/**Constructor. */
Chris Howells's avatar
adding  
Chris Howells committed
40
	KSNumbers( long double jd );
41
	/**Destructor (empty). */
Chris Howells's avatar
adding  
Chris Howells committed
42 43
	~KSNumbers();

44 45 46
	/**@returns the current Obliquity (the angle of inclination between
		*the celestial equator and the ecliptic)
		*/
Chris Howells's avatar
adding  
Chris Howells committed
47
	dms obliquity() const { return Obliquity; }
48 49

	/**@returns the constant of aberration (20.49 arcsec). */
Chris Howells's avatar
adding  
Chris Howells committed
50
	dms constAberr() const { return K; }
51 52

	/**@returns the mean solar anomaly. */
Chris Howells's avatar
adding  
Chris Howells committed
53
	dms sunMeanAnomaly() const { return M; }
54 55

	/**@returns the mean solar longitude. */
Chris Howells's avatar
adding  
Chris Howells committed
56
	dms sunMeanLongitude() const { return L; }
57 58

	/**@returns the true solar anomaly. */
Chris Howells's avatar
adding  
Chris Howells committed
59
	dms sunTrueAnomaly() const { return M0; }
60 61

	/**@returns the true solar longitude. */
Chris Howells's avatar
adding  
Chris Howells committed
62
	dms sunTrueLongitude() const { return L0; }
63 64

	/**@returns the longitude of the Earth's perihelion point. */
Chris Howells's avatar
adding  
Chris Howells committed
65
	dms earthPerihelionLongitude() const { return P; }
66 67 68 69 70

	/**@returns eccentricity of Earth's orbit.*/
	double earthEccentricity() const { return e; }

	/**@returns the change in obliquity due to the nutation of Earth's orbit. */
Chris Howells's avatar
adding  
Chris Howells committed
71
	double dObliq() const { return deltaObliquity; }
72 73

	/**@returns the change in Ecliptic Longitude due to nutation. */
Chris Howells's avatar
adding  
Chris Howells committed
74
	double dEcLong() const { return deltaEcLong; }
75 76

	/**@returns Julian centuries since J2000*/
Chris Howells's avatar
adding  
Chris Howells committed
77
	double julianCenturies() const { return T; }
78 79

	/**@returns Julian Day*/
Chris Howells's avatar
adding  
Chris Howells committed
80
	long double julianDate() const { return days; }
81 82

	/**@returns Julian Millenia since J2000*/
Chris Howells's avatar
adding  
Chris Howells committed
83 84
	double julianMillenia() const { return jm; }

85
	/**@returns element of P1 precession array at position [i1][i2] */
Chris Howells's avatar
adding  
Chris Howells committed
86
	double p1( int i1, int i2 ) const { return P1[i1][i2]; }
87

88 89 90
	/**@returns element of P1 precession array at position [i1][i2] */
	double p1b( int i1, int i2 ) const { return P1B[i1][i2]; }

91
	/**@returns element of P2 precession array at position [i1][i2] */
Chris Howells's avatar
adding  
Chris Howells committed
92 93
	double p2( int i1, int i2 ) const { return P2[i1][i2]; }

94 95 96
	/**@returns element of P2 precession array at position [i1][i2] */
	double p2b( int i1, int i2 ) const { return P2B[i1][i2]; }

97
	/**@short update all values for the date given as an argument. */
Chris Howells's avatar
adding  
Chris Howells committed
98 99 100 101
	void updateValues( long double jd );

private:
	dms Obliquity, K, L, L0, LM, M, M0, O, P;
102
	dms XP, YP, ZP, XB, YB, ZB;
Chris Howells's avatar
adding  
Chris Howells committed
103
	double CX, SX, CY, SY, CZ, SZ;
104 105
	double CXB, SXB, CYB, SYB, CZB, SZB;
	double P1[3][3], P2[3][3], P1B[3][3], P2B[3][3];
Chris Howells's avatar
adding  
Chris Howells committed
106
	double deltaObliquity, deltaEcLong;
107
	double e, T, TB;
Chris Howells's avatar
adding  
Chris Howells committed
108 109 110 111 112 113
	long double days;
	double jm;

};

#endif