Stellarium  0.22.2
Public Member Functions | Static Public Member Functions
KeplerOrbit Class Reference

KeplerOrbit describes an undisturbed orbit in a two-body system. More...

#include <Orbit.hpp>

Public Member Functions

 KeplerOrbit (double epochJDE, double pericenterDistance, double eccentricity, double inclination, double ascendingNode, double argOfPerhelion, double timeAtPerihelion, double orbitGoodDays, double meanMotion, double parentRotObliquity, double parentRotAscendingnode, double parentRotJ2000Longitude, double centralMass=1.0)
 Constructor. More...
 
virtual void positionAtTimevInVSOP87Coordinates (double JDE, double *v) Q_DECL_OVERRIDE
 Compute the object position for a specified Julian day. More...
 
bool getUpdateTails () const
 updating comet tails is a bit expensive. try not to overdo it.
 
void setUpdateTails (const bool update)
 
virtual Vec3d getVelocity () const Q_DECL_OVERRIDE
 return speed value [AU/d] last computed by positionAtTimevInVSOP87Coordinates(JDE, v)
 
virtual void getVelocity (double *vel) const Q_DECL_OVERRIDE
 write speed value [AU/d] into first 3 elements of vel. (zero in the base class)
 
virtual double getSemimajorAxis () const Q_DECL_OVERRIDE
 Returns semimajor axis [AU] for elliptic orbit, 0 for a parabolic orbit, and a negative value [AU] for hyperbolic orbit.
 
virtual double getEccentricity () const Q_DECL_OVERRIDE
 return orbit eccentricity. (zero in the base class)
 
bool objectDateValid (const double JDE) const
 return whether a position returned for JDE can be regarded accurate enough for telescope use. More...
 
bool objectDateGoodEnoughForOrbits (const double JDE) const
 return whether a position returned for JDE would be good enough for at least plotting the orbit. More...
 
Vec2d objectDateValidRange (const bool strict) const
 Return minimal and maximal JDE values where this orbit should be used. More...
 
double calculateSiderealPeriod () const
 Calculate sidereal period in days from semi-major axis and central mass. If SMA<=0 (hyperbolic orbit), return 0.
 
- Public Member Functions inherited from Orbit
void setParentOrientation (const double parentRotObliquity, const double parentRotAscendingNode, const double parentRotJ2000Longitude)
 For planet moons which have orbits given in relation to their parent planet's equator. More...
 

Static Public Member Functions

static double calculateSiderealPeriod (const double semiMajorAxis, const double centralMass)
 

Additional Inherited Members

- Protected Attributes inherited from Orbit
double rotateToVsop87 [9]
 

Detailed Description

This is used for minor bodies orbiting the sun, but also for planet moons. Orbital elements are considered valid for a relatively short time span (orbitGood) around epoch only and should be updated periodically, because the other planets perturbate the orbiting bodies. To avoid using outdated elements, the KeplerOrbit object can be queried using objectDateValid(JDE) whether it makes sense to assume the retrieved positions are close enough to reality to find the object in a telescope. Another test is objectDateGoodEnoughForOrbits(JDE), which test a bit more relaxed, for the sake of retrieving positions for graphics.

Note
This class was called CometOrbit previously, but was now recombined with the former EllipticalOrbit class. They did almost the same.
Algorithms from:
  • Meeus: Astronomical Algorithms 1998
  • Heafner: Fundamental Ephemeris Computations 1999

Constructor & Destructor Documentation

◆ KeplerOrbit()

KeplerOrbit::KeplerOrbit ( double  epochJDE,
double  pericenterDistance,
double  eccentricity,
double  inclination,
double  ascendingNode,
double  argOfPerhelion,
double  timeAtPerihelion,
double  orbitGoodDays,
double  meanMotion,
double  parentRotObliquity,
double  parentRotAscendingnode,
double  parentRotJ2000Longitude,
double  centralMass = 1.0 
)
Parameters
epochJDEJDE epoch of orbital elements.
pericenterDistance[AU] pericenter distance
eccentricity0..>1 (>>1 for Interstellar objects)
inclination[radians]
ascendingNode[radians]
argOfPerhelion[radians]
timeAtPerihelionJDE
orbitGoodDays[earth days] can be used to exclude computation for dates too far outside epoch. 0: always good (use that for planet moons. Not really correct, but most users won't care) -1: signal "auto-compute to 1/2 the orbital period or 1000 days if there is no period [e>=1]")
meanMotion[radians/day] for parabolics, this is W/dt in Heafner's lettering
parentRotObliquity[radians] Comets/Minor Planets only have parent==sun, no need for these? --> Oh yes, these relate VSOP/J2000 eq frames!
parentRotAscendingnode[radians]
parentRotJ2000Longitude[radians]
centralMasscentral mass in Solar masses. Velocity value depends on this!

Member Function Documentation

◆ calculateSiderealPeriod()

static double KeplerOrbit::calculateSiderealPeriod ( const double  semiMajorAxis,
const double  centralMass 
)
static
Parameters
semiMajorAxisin AU. If SMA<=0 (hyperbolic orbit), return 0.
centralMassin units of Solar masses

◆ objectDateGoodEnoughForOrbits()

bool KeplerOrbit::objectDateGoodEnoughForOrbits ( const double  JDE) const
inline

This is true for dates within orbitGood around epoch. If orbitGood is zero, this is always true.

Note
This relieves conditions of objectDateValid(JDE) somewhat, for the sake of illustratory completeness.

◆ objectDateValid()

bool KeplerOrbit::objectDateValid ( const double  JDE) const
inline

This is limited to dates within 1 year or epoch, or within orbitGood around epoch, whichever is smaller. If orbitGood is zero, this is always true.

Note
This will still return false positives after close encounters with major masses which change orbital parameters. However, it should catch the usual case of outdated orbital elements which should be updated at least yearly.

◆ objectDateValidRange()

Vec2d KeplerOrbit::objectDateValidRange ( const bool  strict) const
Returns
the limits where objectDateValid returns true

◆ positionAtTimevInVSOP87Coordinates()

virtual void KeplerOrbit::positionAtTimevInVSOP87Coordinates ( double  JDE,
double *  v 
)
virtual
Parameters
JDEJulian Ephemeris Day
vdouble vector of at least 3 elements. The first three will receive X/Y/Z values in AU.

Reimplemented from Orbit.