Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

Jupiter.cpp

Go to the documentation of this file.
00001 /*
00002  * Jupiter.cpp
00003  *
00004  * Part of Fly! Legacy project
00005  *
00006  * Copyright 2003 Chris Wallace
00007  *
00008  * Fly! Legacy is free software; you can redistribute it and/or modify
00009  *   it under the terms of the GNU General Public License as published by
00010  *   the Free Software Foundation; either version 2 of the License, or
00011  *   (at your option) any later version.
00012  *
00013  * Fly! Legacy is distributed in the hope that it will be useful,
00014  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  *   GNU General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU General Public License
00019  *   along with Fly! Legacy; if not, write to the Free Software
00020  *    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00021  *
00022  */
00023 
00032 #include <math.h>
00033 #include "../Include/Ephemeris.h"
00034 
00035 
00036 //
00037 // Default orbital elements
00038 //
00039 static SOrbitalElements first =
00040 {
00041   100.4542,   // N, Longitude of the ascending node
00042   1.3030,     // i, Inclination to the ecliptic
00043   273.8777,   // w, Argument of perihelion
00044   5.2025600,    // a, Semi-major axis
00045   0.048498,   // e, Eccentricity
00046   19.89500    // M, Mean anomaly
00047 };
00048 
00049 static SOrbitalElements second =
00050 {
00051   2.7685400E-5, // N, Longitude of the ascending node
00052   -1.557E-7,    // i, Inclination to the ecliptic
00053   1.6450500E-5, // w, Argument of perihelion
00054   0.0,      // a, Semi-major axis
00055   4.469E-9,   // e, Eccentricity
00056   0.08308530010 // M, Mean anomaly
00057 };
00058 
00059 
00060 /*************************************************************************
00061  * CJupiter::CJupiter(double mjd)
00062  * Public constructor for class CJupiter
00063  * Argument: The current time.
00064  * the hard coded orbital elements for CJupiter are passed to 
00065  * CelestialBody::CelestialBody();
00066  ************************************************************************/
00067 CJupiter::CJupiter(double mjd) :
00068   CCelestialBody (first.N, first.i, first.w, first.a, first.e, first.M,
00069                 second.N, second.i, second.w, second.a, second.e, second.M,
00070           mjd)
00071 {
00072 }
00073 
00074 CJupiter::CJupiter() :
00075   CCelestialBody (first.N, first.i, first.w, first.a, first.e, first.M,
00076                 second.N, second.i, second.w, second.a, second.e, second.M)
00077 {
00078 }
00079 
00080 
00081 /*************************************************************************
00082  * void CJupiter::updatePosition(double mjd, CSol *ourSun)
00083  * 
00084  * calculates the current position of CJupiter, by calling the base class,
00085  * CelestialBody::updatePosition(); The current magnitude is calculated using 
00086  * a Jupiter specific equation
00087  *************************************************************************/
00088 void CJupiter::UpdatePosition(double mjd, CSol *ourSun)
00089 {
00090   CCelestialBody::UpdatePosition(mjd, ourSun);
00091   magnitude = -9.25 + 5*log10( r*R ) + 0.014 * FV;
00092 }
00093 
00094 
00095 /**************************************************************************
00096  * jupiter.cxx
00097  * Written by Durk Talsma. Originally started October 1997, for distribution  
00098  * with the FlightGear project. Version 2 was written in August and 
00099  * September 1998. This code is based upon algorithms and data kindly 
00100  * provided by Mr. Paul Schlyter. (pausch@saaf.se). 
00101  *
00102  * This library is free software; you can redistribute it and/or
00103  * modify it under the terms of the GNU Library General Public
00104  * License as published by the Free Software Foundation; either
00105  * version 2 of the License, or (at your option) any later version.
00106  *
00107  * This library is distributed in the hope that it will be useful,
00108  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00109  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00110  * Library General Public License for more details.
00111  *
00112  * You should have received a copy of the GNU Library General Public
00113  * License along with this library; if not, write to the
00114  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00115  * Boston, MA  02111-1307, USA.
00116  *
00117  **************************************************************************/
00118 
SourceForge.net Logo Documentation generated by doxygen