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