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