• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

kstars

  • sources
  • kde-4.12
  • kdeedu
  • kstars
  • kstars
  • skyobjects
kspluto.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  kspluto.cpp - K Desktop Planetarium
3  -------------------
4  begin : Mon Sep 24 2001
5  copyright : (C) 2001 by Jason Harris
6  email : kstars@30doradus.org
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #include "kspluto.h"
19 
20 #include <cmath>
21 
22 #include <QFile>
23 
24 #include <kdebug.h>
25 
26 #include "ksnumbers.h"
27 #include "kstarsdatetime.h" //for J2000 define
28 
29 #ifdef B0
30 // There are systems that #define B0 as a special termios flag (for baud rate)
31 #undef B0
32 #endif
33 
34 KSPluto::KSPluto(const QString &fn, double pSize )
35  : KSAsteroid( 0, i18n("Pluto"), fn, J2000,
36  39.48168677, 0.24880766, dms(17.14175), dms(113.76329),
37  dms(110.30347), dms(14.86205), 1.0, 0.0 )
38 {
39  //Initialize the base orbital element values for J2000:
40  a0 = 39.48168677; //semi-major axis (AU)
41  e0 = 0.24880766; //eccentricity
42  i0.setD( 17.14175 ); //inclination (degrees)
43  w0.setD( 113.76329 ); //argument of perihelion (degrees)
44  N0.setD( 110.30347 ); //long. of ascending node (degrees)
45  M0.setD( 14.86205 ); //mean anomaly (degrees)
46 
47  //rate-of-change values for the orbital elements
48  a1 = -0.00076912; // da/dt (AU/cnetury)
49  e1 = 0.00006465; // de/dt (1/century)
50  i1 = 11.07/3600.; // di/dt (degrees/century)
51  w1 = -94.92/3600.; // dw/dt (degrees/century)
52  N1 = -37.33/3600.; // dN/dt (degrees/century)
53  M1 = 522880.15/3600.; // dM/dt (degrees/century)
54 
55  setPhysicalSize( pSize );
56 }
57 
58 KSPluto* KSPluto::clone() const
59 {
60  return new KSPluto(*this);
61 }
62 
63 KSPluto::~KSPluto() {
64 }
65 
66 //Determine values for the orbital elements for the requested JD, then
67 //call KSAsteroid::findGeocentricPosition()
68 bool KSPluto::findGeocentricPosition( const KSNumbers *num, const KSPlanetBase *Earth ) {
69  //First, set the orbital element values according to the current epoch
70  double t = num->julianCenturies();
71  set_a( a0 + a1*t );
72  set_e( e0 + e1*t );
73  set_i( i0.Degrees() + i1*t );
74  set_N( N0.Degrees() + N1*t );
75  set_M( M0.Degrees() + M1*t );
76  set_P( 365.2568984 * pow((a0+a1*t), 1.5) ); //set period from Kepler's 3rd law
77  setJD( num->julianDay() );
78 
79  return KSAsteroid::findGeocentricPosition( num, Earth );
80 }
81 
82 void KSPluto::findMagnitude(const KSNumbers*)
83 {
84  setMag( -1.01 + 5*log10(rsun() * rearth()) + 0.041*phase().Degrees() );
85 }
KSAsteroid::set_a
void set_a(double newa)
Definition: ksasteroid.h:196
KSAsteroid::setJD
void setJD(long double jd)
Definition: ksasteroid.h:203
dms::Degrees
const double & Degrees() const
Definition: dms.h:98
KSAsteroid::set_i
void set_i(double newi)
Definition: ksasteroid.h:199
KSPluto::findGeocentricPosition
virtual bool findGeocentricPosition(const KSNumbers *num, const KSPlanetBase *Earth=NULL)
A custom findPosition() function for Pluto.
Definition: kspluto.cpp:68
kspluto.h
KSPluto::~KSPluto
virtual ~KSPluto()
Destructor (empty)
Definition: kspluto.cpp:63
KSPlanetBase::rsun
double rsun() const
Definition: ksplanetbase.h:126
KSNumbers::julianDay
long double julianDay() const
Definition: ksnumbers.h:93
KSAsteroid
A subclass of KSPlanetBase that implements asteroids.
Definition: ksasteroid.h:48
ksnumbers.h
dms
An angle, stored as degrees, but expressible in many ways.
Definition: dms.h:42
KSAsteroid::set_N
void set_N(double newN)
Definition: ksasteroid.h:202
KSAsteroid::set_P
void set_P(double newP)
Definition: ksasteroid.h:198
SkyObject::setMag
void setMag(float m)
Set the object's sorting magnitude.
Definition: skyobject.h:409
KSNumbers
There are several time-dependent values used in position calculations, that are not specific to an ob...
Definition: ksnumbers.h:43
KSPlanetBase::rearth
double rearth() const
Definition: ksplanetbase.h:134
J2000
#define J2000
Definition: kstarsdatetime.h:21
KSPlanetBase::setPhysicalSize
void setPhysicalSize(double size)
set the planet's physical size, in km.
Definition: ksplanetbase.h:184
KSPluto::clone
virtual KSPluto * clone() const
Create copy of object.
Definition: kspluto.cpp:58
KSPlanetBase
A subclass of TrailObject that provides additional information needed for most solar system objects...
Definition: ksplanetbase.h:63
kstarsdatetime.h
dms::setD
void setD(const double &x)
Sets floating-point value of angle, in degrees.
Definition: dms.h:130
KSPluto::KSPluto
KSPluto(const QString &fn=QString(), double pSize=0)
Constructor.
Definition: kspluto.cpp:34
KSAsteroid::findGeocentricPosition
virtual bool findGeocentricPosition(const KSNumbers *num, const KSPlanetBase *Earth=NULL)
Calculate the geocentric RA, Dec coordinates of the Asteroid.
Definition: ksasteroid.cpp:41
KSNumbers::julianCenturies
double julianCenturies() const
Definition: ksnumbers.h:90
KSAsteroid::set_e
void set_e(double newe)
Definition: ksasteroid.h:197
KSAsteroid::set_M
void set_M(double newM)
Definition: ksasteroid.h:201
KSPlanetBase::phase
dms phase()
Definition: ksplanetbase.h:187
KSPluto
A subclass of KSAsteroid that represents the planet Pluto.
Definition: kspluto.h:43
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:36:20 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kstars

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

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal