• Skip to content
  • Skip to link menu
KDE 3.5 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

kstars

kspluto.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002                           kspluto.cpp  -  K Desktop Planetarium
00003                              -------------------
00004     begin                : Mon Sep 24 2001
00005     copyright            : (C) 2001 by Jason Harris
00006     email                : kstars@30doradus.org
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #include <math.h>
00019 
00020 #include <qfile.h>
00021 #include <kdebug.h>
00022 
00023 #include "kspluto.h"
00024 #include "ksutils.h"
00025 #include "ksnumbers.h"
00026 
00027 #ifdef B0
00028 // There are systems that #define B0 as a special termios flag (for baud rate)
00029 #undef B0
00030 #endif
00031 
00032 KSPluto::KSPluto(KStarsData *kd, QString fn, double pSize ) 
00033         : KSAsteroid( kd, I18N_NOOP( "Pluto" ), fn, J2000, 
00034             39.48168677, 0.24880766, dms(17.14175), dms(113.76329),
00035             dms(110.30347), dms(14.86205), 1.0 ) {
00036     //Initialize the base orbital element values for J2000:
00037     a0 = 39.48168677; //semi-major axis (AU)
00038     e0 = 0.24880766;  //eccentricity
00039     i0.setD( 17.14175 );    //inclination (degrees)
00040     w0.setD( 113.76329 );   //argument of perihelion (degrees)
00041     N0.setD( 110.30347 );   //long. of ascending node (degrees)
00042     M0.setD(  14.86205 );   //mean anomaly (degrees)
00043 
00044     //rate-of-change values for the orbital elements
00045     a1 = -0.00076912;     // da/dt (AU/cnetury)
00046     e1 = 0.00006465;      // de/dt (1/century)
00047     i1 = 11.07/3600.;     // di/dt (degrees/century)
00048     w1 = -94.92/3600.;   // dw/dt (degrees/century)
00049     N1 = -37.33/3600.;    // dN/dt (degrees/century)
00050     M1 = 522880.15/3600.; // dM/dt (degrees/century)
00051 
00052     setPhysicalSize( pSize );
00053     setType( 2 ); //It's really a planet, not an asteroid
00054 }
00055 
00056 KSPluto::~KSPluto() {
00057 }
00058 
00059 //Determine values for the orbital elements for the requested JD, then 
00060 //call KSAsteroid::findGeocentricPosition()
00061 bool KSPluto::findGeocentricPosition( const KSNumbers *num, const KSPlanetBase *Earth ) {
00062     //First, set the orbital element values according to the current epoch
00063     double t = num->julianCenturies();
00064     set_a( a0 + a1*t );
00065     set_e( e0 + e1*t );
00066     set_i( i0.Degrees() + i1*t );
00067     set_N( N0.Degrees() + N1*t );
00068     set_M( M0.Degrees() + M1*t );
00069     set_P( 365.2568984 * pow((a0+a1*t), 1.5) ); //set period from Kepler's 3rd law
00070     setJD( num->julianDay() );
00071 
00072     return KSAsteroid::findGeocentricPosition( num, Earth );
00073 }

kstars

Skip menu "kstars"
  • Main Page
  • Modules
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • keduca
  • kstars
Generated for API Reference by doxygen 1.5.9
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal