Kstars

kspluto.cpp
1/*
2 SPDX-FileCopyrightText: 2001 Jason Harris <kstars@30doradus.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#include "kspluto.h"
8
9#include <typeinfo>
10
11#include <cmath>
12
13#include <QFile>
14
15#include <QDebug>
16
17#include "ksnumbers.h"
18#include "kstarsdatetime.h" //for J2000 define
19
20#ifdef B0
21// There are systems that #define B0 as a special termios flag (for baud rate)
22#undef B0
23#endif
24
25KSPluto::KSPluto(const QString &fn, double pSize)
26 : KSAsteroid(0, xi18n("Pluto"), fn, J2000, 39.48168677, 0.24880766, dms(17.14175), dms(113.76329), dms(110.30347),
27 dms(14.86205), 1.0, 0.0)
28{
29 //Initialize the base orbital element values for J2000:
30 a0 = 39.48168677; //semi-major axis (AU)
31 e0 = 0.24880766; //eccentricity
32 i0.setD(17.14175); //inclination (degrees)
33 w0.setD(113.76329); //argument of perihelion (degrees)
34 N0.setD(110.30347); //long. of ascending node (degrees)
35 M0.setD(14.86205); //mean anomaly (degrees)
36
37 //rate-of-change values for the orbital elements
38 a1 = -0.00076912; // da/dt (AU/century)
39 e1 = 0.00006465; // de/dt (1/century)
40 i1 = 11.07 / 3600.; // di/dt (degrees/century)
41 w1 = -94.92 / 3600.; // dw/dt (degrees/century)
42 N1 = -37.33 / 3600.; // dN/dt (degrees/century)
43 M1 = 522880.15 / 3600.; // dM/dt (degrees/century)
44
45 setPhysicalSize(pSize);
46}
47
49{
50 Q_ASSERT(typeid(this) == typeid(static_cast<const KSPluto *>(this))); // Ensure we are not slicing a derived class
51 return new KSPluto(*this);
52}
53
57
58//Determine values for the orbital elements for the requested JD, then
59//call KSAsteroid::findGeocentricPosition()
61{
62 //First, set the orbital element values according to the current epoch
63 double t = num->julianCenturies();
64 set_a(a0 + a1 * t);
65 set_e(e0 + e1 * t);
66 set_i(i0.Degrees() + i1 * t);
67 set_N(N0.Degrees() + N1 * t);
68 set_M(M0.Degrees() + M1 * t);
69 set_P(365.2568984 * pow((a0 + a1 * t), 1.5)); //set period from Kepler's 3rd law
70 setJD(num->julianDay());
71
72 return KSAsteroid::findGeocentricPosition(num, Earth);
73}
74
75void KSPluto::findMagnitude(const KSNumbers *)
76{
77 setMag(-1.01 + 5 * log10(rsun() * rearth()) + 0.041 * phase().Degrees());
78}
A subclass of KSPlanetBase that implements asteroids.
Definition ksasteroid.h:42
bool findGeocentricPosition(const KSNumbers *num, const KSPlanetBase *Earth=nullptr) override
Calculate the geocentric RA, Dec coordinates of the Asteroid.
There are several time-dependent values used in position calculations, that are not specific to an ob...
Definition ksnumbers.h:43
double julianCenturies() const
Definition ksnumbers.h:88
long double julianDay() const
Definition ksnumbers.h:91
A subclass of TrailObject that provides additional information needed for most solar system objects.
void setPhysicalSize(double size)
set the planet's physical size, in km.
double rearth() const
double rsun() const
A subclass of KSAsteroid that represents the planet Pluto.
Definition kspluto.h:33
KSPluto(const QString &fn=QString(), double pSize=0)
Constructor.
Definition kspluto.cpp:25
bool findGeocentricPosition(const KSNumbers *num, const KSPlanetBase *Earth=nullptr) override
A custom findPosition() function for Pluto.
Definition kspluto.cpp:60
~KSPluto() override
Destructor (empty)
Definition kspluto.cpp:54
KSPluto * clone() const override
Create copy of object.
Definition kspluto.cpp:48
void setMag(float m)
Set the object's sorting magnitude.
Definition skyobject.h:404
QString xi18n(const char *text, const TYPE &arg...)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:16:41 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.