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

Venus.cpp

Go to the documentation of this file.
00001 /*
00002  * Venus.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   76.67990,   // N, Longitude of the ascending node
00042   3.3946,     // i, Inclination to the ecliptic
00043   54.89100,   // w, Argument of perihelion
00044   0.7233300,    // a, Semi-major axis
00045   0.006773,   // e, Eccentricity
00046   48.00520    // M, Mean anomaly
00047 };
00048 
00049 static SOrbitalElements second =
00050 {
00051   2.4659000E-5, // N, Longitude of the ascending node
00052   2.75E-8,    // i, Inclination to the ecliptic
00053   1.3837400E-5, // w, Argument of perihelion
00054   0.0,      // a, Semi-major axis
00055   -1.302E-9,    // e, Eccentricity
00056   1.60213022440 // M, Mean anomaly
00057 };
00058 
00059 
00060 
00061 /*************************************************************************
00062  * CVenus::CVenus(double mjd)
00063  * Public constructor for class CVenus
00064  * Argument: The current time.
00065  * the hard coded orbital elements for CVenus are passed to 
00066  * CelestialBody::CelestialBody();
00067  ************************************************************************/
00068 CVenus::CVenus(double mjd) :
00069   CCelestialBody (first.N, first.i, first.w, first.a, first.e, first.M,
00070                 second.N, second.i, second.w, second.a, second.e, second.M,
00071           mjd)
00072 {
00073 }
00074 
00075 CVenus::CVenus() :
00076   CCelestialBody (first.N, first.i, first.w, first.a, first.e, first.M,
00077                 second.N, second.i, second.w, second.a, second.e, second.M)
00078 {
00079 }
00080 
00081 
00082 /*************************************************************************
00083  * void CVenus::updatePosition(double mjd, CSol *ourSun)
00084  * 
00085  * calculates the current position of Venus, by calling the base class,
00086  * CelestialBody::updatePosition(); The current magnitude is calculated using 
00087  * a Venus specific equation
00088  *************************************************************************/
00089 void CVenus::UpdatePosition(double mjd, CSol *ourSun)
00090 {
00091   CCelestialBody::UpdatePosition(mjd, ourSun);
00092   magnitude = -4.34 + 5*log10( r*R ) + 0.013 * FV + 4.2E-07 * pow(FV,3);
00093 }
00094 
00095 
00096 /**************************************************************************
00097  * venus.cxx
00098  * Written by Durk Talsma. Originally started October 1997, for distribution  
00099  * with the FlightGear project. Version 2 was written in August and 
00100  * September 1998. This code is based upon algorithms and data kindly 
00101  * provided by Mr. Paul Schlyter. (pausch@saaf.se). 
00102  *
00103  * This library is free software; you can redistribute it and/or
00104  * modify it under the terms of the GNU Library General Public
00105  * License as published by the Free Software Foundation; either
00106  * version 2 of the License, or (at your option) any later version.
00107  *
00108  * This library is distributed in the hope that it will be useful,
00109  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00110  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00111  * Library General Public License for more details.
00112  *
00113  * You should have received a copy of the GNU Library General Public
00114  * License along with this library; if not, write to the
00115  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00116  * Boston, MA  02111-1307, USA.
00117  *
00118  **************************************************************************/
SourceForge.net Logo Documentation generated by doxygen