ksasteroid.h 6.47 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/***************************************************************************
                          ksasteroid.h  -  K Desktop Planetarium
                             -------------------
    begin                : Wed 19 Feb 2003
    copyright            : (C) 2001 by Jason Harris
    email                : jharris@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.                                   *
 *                                                                         *
 ***************************************************************************/

18
19
#ifndef KSASTEROID_H_
#define KSASTEROID_H_
20
21
22

#include "ksplanetbase.h"

23
24
25
class KSNumbers;
class dms;

26
/** @class KSAsteroid
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
	*@short A subclass of KSPlanetBase that implements asteroids.
	*
	*The orbital elements are stored as private member variables, and it
	*provides methods to compute the ecliptic coordinates for any time
	*from the orbital elements.
	*
	*The orbital elements are:
	*@li JD    Epoch of element values
	*@li a     semi-major axis length (AU)
	*@li e     eccentricity of orbit
	*@li i     inclination angle (with respect to J2000.0 ecliptic plane)
	*@li w     argument of perihelion (w.r.t. J2000.0 ecliptic plane)
	*@li N     longitude of ascending node (J2000.0 ecliptic)
	*@li M     mean anomaly at epoch JD
	*@li H     absolute magnitude
42
	*@li G     slope parameter
43
44
45
46
	*
	*@author Jason Harris
	*@version 1.0
	*/
47
48
class KSAsteroid : public KSPlanetBase
{
49
public:
50

51
    /** Constructor.
52
53
        *@p catN number of asteroid
    	*@p s    the name of the asteroid
54
55
56
57
58
59
60
61
62
    	*@p image_file the filename for an image of the asteroid
    	*@p JD the Julian Day for the orbital elements
    	*@p a the semi-major axis of the asteroid's orbit (AU)
    	*@p e the eccentricity of the asteroid's orbit
    	*@p i the inclination angle of the asteroid's orbit
    	*@p w the argument of the orbit's perihelion
    	*@p N the longitude of the orbit's ascending node
    	*@p M the mean anomaly for the Julian Day
    	*@p H absolute magnitude
63
        *@p G slope parameter
64
    	*/
65
    KSAsteroid( int catN, const QString &s, const QString &image_file,
66
                long double JD, double a, double e, dms i, dms w, dms N, dms M, double H, double G );
67

68
    virtual KSAsteroid* clone() const;
69
70
    virtual SkyObject::UID getUID() const;

71
    /** Destructor (empty)*/
72
    virtual ~KSAsteroid() {}
73

74
    /** This is inherited from KSPlanetBase.  We don't use it in this class,
75
76
77
    	*so it is empty.
    	*/
    virtual bool loadData();
78

79
    /** This lets other classes like KSPlanetBase access H and G values
80
81
	*Used by KSPlanetBase::FindMagnitude
	*/
Henry de Valence's avatar
Henry de Valence committed
82
83
    double inline getAbsoluteMagnitude() const { return H; }
    double inline getSlopeParameter() const { return G; }
84
85
86
87
88
89
90
91
92

    /**
     *@short Sets the asteroid's perihelion distance
     */
    void setPerihelion( double perihelion );

    /**
     *@return Perihelion distance
     */
Henry de Valence's avatar
Henry de Valence committed
93
    inline double getPerihelion() const { return q; }
94
95
96
97
98
99
100

   /**
     *@short Sets the asteroid's earth minimum orbit intersection distance
     */
    void setEarthMOID( double earth_moid );

    /**
Jasem Mutlaq's avatar
Jasem Mutlaq committed
101
     *@return the asteroid's earth minimum orbit intersection distance in AU
102
     */
Henry de Valence's avatar
Henry de Valence committed
103
    inline double getEarthMOID() const { return EarthMOID; }
104
105
106
107
108
109
110
111
112

    /**
     *@short Sets the asteroid's orbit solution ID
     */
    void setOrbitID( QString orbit_id );

    /**
     *@return the asteroid's orbit solution ID
     */
Henry de Valence's avatar
Henry de Valence committed
113
    inline QString getOrbitID() const { return OrbitID; }
114
115
116
117
118
119
120
121
122

    /**
     *@short Sets the asteroid's orbit class
     */
    void setOrbitClass( QString orbit_class );

    /**
     *@return the asteroid's orbit class
     */
Henry de Valence's avatar
Henry de Valence committed
123
    inline QString getOrbitClass() const { return OrbitClass; }
124
125
126
127
128
129
130
131
132

    /**
     *@short Sets if the comet is a near earth object
     */
    void setNEO( bool neo );

    /**
     *@return true if the asteroid is a near earth object
     */
Henry de Valence's avatar
Henry de Valence committed
133
    inline bool isNEO() const { return NEO; }
134
135
136
137
138
139
140
141
142

    /**
     *@short Sets the asteroid's albedo
     */
    void setAlbedo( float albedo );

    /**
     *@return the asteroid's albedo
     */
Henry de Valence's avatar
Henry de Valence committed
143
    inline float getAlbedo() const { return Albedo; }
144
145
146
147
148
149
150
151
152

    /**
     *@short Sets the asteroid's diameter
     */
    void setDiameter( float diam );

    /**
     *@return the asteroid's diameter
     */
Henry de Valence's avatar
Henry de Valence committed
153
    inline float getDiameter() const { return Diameter; }
154
155
156
157
158
159
160
161
162

    /**
     *@short Sets the asteroid's dimensions
     */
    void setDimensions( QString dim );

    /**
     *@return the asteroid's dimensions
     */
Henry de Valence's avatar
Henry de Valence committed
163
    inline QString getDimensions() const { return Dimensions; }
164
165
166
167
168
169
170
171
172

     /**
     *@short Sets the asteroid's rotation period
     */
    void setRotationPeriod( float rot_per );

    /**
     *@return the asteroid's rotation period
     */
Henry de Valence's avatar
Henry de Valence committed
173
    inline float getRotationPeriod() const { return RotationPeriod; }
174
175
176
177
178
179
180
181
182

     /**
     *@short Sets the asteroid's period
     */
    void setPeriod( float per );

    /**
     *@return the asteroid's period
     */
Henry de Valence's avatar
Henry de Valence committed
183
    inline float getPeriod() const { return Period; }
184

185
protected:
186
    /** Calculate the geocentric RA, Dec coordinates of the Asteroid.
187
188
189
190
191
192
    	*@note reimplemented from KSPlanetBase
    	*@param num time-dependent values for the desired date
    	*@param Earth planet Earth (needed to calculate geocentric coords)
    	*@return true if position was successfully calculated.
    	*/
    virtual bool findGeocentricPosition( const KSNumbers *num, const KSPlanetBase *Earth=NULL );
193

194
195
196
197
198
199
200
201
202
    //these set functions are needed for the new KSPluto subclass
    void set_a( double newa ) { a = newa; }
    void set_e( double newe ) { e = newe; }
    void set_P( double newP ) { P = newP; }
    void set_i( double newi ) { i.setD( newi ); }
    void set_w( double neww ) { w.setD( neww ); }
    void set_M( double newM ) { M.setD( newM ); }
    void set_N( double newN ) { N.setD( newN ); }
    void setJD( long double jd ) { JD = jd; }
203

204
private:
205
206
    virtual void findMagnitude(const KSNumbers*);
    
207
    int catN;
208
    long double JD;
209
210
    double q, a, e, P, EarthMOID;
    float Albedo, Diameter, RotationPeriod, Period;
211
    dms i, w, M, N;
212
    double H, G;
213
214
    QString OrbitID, OrbitClass, Dimensions;
    bool NEO;
215
216
217
};

#endif