PlanetMoons

Search for usage in LXR

PlanetMoons Class Referenceabstract

#include <planetmoons.h>

Inheritance diagram for PlanetMoons:

Public Member Functions

 PlanetMoons ()=default
 
virtual ~PlanetMoons ()
 
void EquatorialToHorizontal (const dms *LSTh, const dms *lat)
 
virtual void findPosition (const KSNumbers *num, const KSPlanetBase *pla, const KSSun *sunptr)=0
 
bool inFront (int id) const
 
TrailObjectmoon (int id)
 
QString name (int id) const
 
int nMoons () const
 
double x (int i) const
 
double y (int i) const
 
double z (int i) const
 

Protected Attributes

QVector< bool > InFront
 
QVector< TrailObject * > Moon
 
QVector< double > XP
 
QVector< double > YP
 
QVector< double > ZP
 

Detailed Description

Implements the moons of a planet.

TODO: make the moons SkyObjects, rather than just points.

Author
Vipul Kumar Singh
Version
1.0

Definition at line 29 of file planetmoons.h.

Constructor & Destructor Documentation

◆ PlanetMoons()

PlanetMoons::PlanetMoons ( )
default

Constructor.

Assign the name of each moon, and initialize their XYZ positions to zero.

◆ ~PlanetMoons()

PlanetMoons::~PlanetMoons ( )
virtual

Destructor.

Delete moon objects

Definition at line 17 of file planetmoons.cpp.

Member Function Documentation

◆ EquatorialToHorizontal()

void PlanetMoons::EquatorialToHorizontal ( const dms * LSTh,
const dms * lat )

Convert the RA,Dec coordinates of each moon to Az,Alt.

Parameters
LSThpointer to the current local sidereal time
latpointer to the geographic latitude

Definition at line 27 of file planetmoons.cpp.

◆ findPosition()

virtual void PlanetMoons::findPosition ( const KSNumbers * num,
const KSPlanetBase * pla,
const KSSun * sunptr )
pure virtual

Find the positions of each Moon, relative to the planet.

We use an XYZ coordinate system, centered on the planet, where the X-axis corresponds to the planet's Equator, the Y-Axis is parallel to the planet's Poles, and the Z-axis points along the line joining the Earth and the planet. Once the XYZ positions are known, this function also computes the RA, Dec positions of each Moon, and sets the inFront bool variable to indicate whether the Moon is nearer to us than the planet or not (this information is used to determine whether the Moon should be drawn on top of the planet, or vice versa).

Parameters
numpointer to the KSNumbers object describing the date/time at which to find the positions.
plapointer to the planet object
sunptrpointer to the Sun object

Implemented in JupiterMoons.

◆ inFront()

bool PlanetMoons::inFront ( int id) const
inline
Returns
true if the Moon is nearer to Earth than Saturn.
Parameters
idwhich moon? 0=Mimas,1=Enceladus,2=Tethys,3=Dione,4=Rhea,5=Titan,6=Hyperion,7=Lapetus

Definition at line 86 of file planetmoons.h.

◆ moon()

TrailObject * PlanetMoons::moon ( int id)
inline
Returns
pointer to a moon given the ID number.
Parameters
idwhich moon?

Definition at line 45 of file planetmoons.h.

◆ name()

QString PlanetMoons::name ( int id) const
Returns
the name of a moon.
Parameters
idwhich moon?

Definition at line 22 of file planetmoons.cpp.

◆ nMoons()

int PlanetMoons::nMoons ( ) const
inline
Returns
the number of moons around the planet

Definition at line 107 of file planetmoons.h.

◆ x()

double PlanetMoons::x ( int i) const
inline
Returns
the X-coordinate in the planet-centered coord. system.
Parameters
iwhich moon?

Definition at line 92 of file planetmoons.h.

◆ y()

double PlanetMoons::y ( int i) const
inline
Returns
the Y-coordinate in the planet-centered coord. system.
Parameters
iwhich moon?

Definition at line 98 of file planetmoons.h.

◆ z()

double PlanetMoons::z ( int i) const
inline
Returns
the Z-coordinate in the Planet-centered coord. system.
Parameters
iwhich moon?

Definition at line 104 of file planetmoons.h.

Member Data Documentation

◆ InFront

QVector<bool> PlanetMoons::InFront
protected

Definition at line 111 of file planetmoons.h.

◆ Moon

QVector<TrailObject *> PlanetMoons::Moon
protected

Definition at line 110 of file planetmoons.h.

◆ XP

QVector<double> PlanetMoons::XP
protected

Definition at line 113 of file planetmoons.h.

◆ YP

QVector<double> PlanetMoons::YP
protected

Definition at line 113 of file planetmoons.h.

◆ ZP

QVector<double> PlanetMoons::ZP
protected

Definition at line 113 of file planetmoons.h.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:16:42 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.