SuperNOVAS C++ API v1.6
High-precision C/C++ astrometry library
Loading...
Searching...
No Matches
supernovas::ScalarEvolution Class Reference

The evolution of a scalar quantity in time, based on a local quadratic approximation. More...

#include <supernovas.h>

Inheritance diagram for supernovas::ScalarEvolution:

Public Member Functions

 ScalarEvolution (double value, double rate=0.0, double accel=0.0)
 Instantiate an time evolution set for a scalar quantity.
double acceleration () const
 Returns the defined (constant) acceleration value.
double rate (const Interval &offset=Interval::zero()) const
 Returns an extrapolated momentary rate of change for the evolving quantity at an offset time, using the defined acceleration.
double value (const Interval &offset=Interval::zero()) const
 Returns an extrapolated momentary value of the evolving quantity at an offset time, using the defined derivatives.
Public Member Functions inherited from supernovas::Validating
bool is_valid () const
 Returns the previously set 'valid' stae of the implementing instance.
 operator bool () const
 Objects that implement Validating can be used in conditionals directly, without explicitly calling is_valid().

Static Public Member Functions

static ScalarEvolution stationary (double value)
 Returns a new scalar evolution instance for a stationary quantity.
static const ScalarEvolution & undefined ()
 Returns a reference to a statically allocated undefined scalar evolution instance.

Additional Inherited Members

Protected Member Functions inherited from supernovas::Validating
 Validating ()
 dummy constructor;
Protected Attributes inherited from supernovas::Validating
bool _valid = false
 the state variable.

Detailed Description

The evolution of a scalar quantity in time, based on a local quadratic approximation.

See also
Track

Constructor & Destructor Documentation

◆ ScalarEvolution()

supernovas::ScalarEvolution::ScalarEvolution ( double value,
double rate = 0.0,
double accel = 0.0 )
explicit

Instantiate an time evolution set for a scalar quantity.

Parameters
value[?] momentary value
rate[?/s] (optional) momentary rate of change in value (default: 0).
accel[?/s2] (optional) momentary acceleration of value (default: 0).

References supernovas::Validating::_valid, rate(), and value().

Member Function Documentation

◆ acceleration()

double supernovas::ScalarEvolution::acceleration ( ) const

Returns the defined (constant) acceleration value.

Returns
the acceleration that was defined.
See also
value(), rate()

◆ rate()

double supernovas::ScalarEvolution::rate ( const Interval & offset = Interval::zero()) const

Returns an extrapolated momentary rate of change for the evolving quantity at an offset time, using the defined acceleration.

Parameters
offsettime offset from when reference value and derivatives were defined.
Returns
the extrapolated momentary rate of change at the offset time.
See also
value(), acceleration()

References supernovas::Interval::seconds().

Referenced by ScalarEvolution().

◆ stationary()

ScalarEvolution supernovas::ScalarEvolution::stationary ( double value)
static

Returns a new scalar evolution instance for a stationary quantity.

Parameters
valueThe stationary (unevolving) value
Returns
a non-evolving scalar evolution instance with the specified stationary value.

References supernovas::Validating::is_valid(), and value().

◆ undefined()

const ScalarEvolution & supernovas::ScalarEvolution::undefined ( )
static

Returns a reference to a statically allocated undefined scalar evolution instance.

Returns
a reference to a static undefined scalar evolution instance.

◆ value()

double supernovas::ScalarEvolution::value ( const Interval & offset = Interval::zero()) const

Returns an extrapolated momentary value of the evolving quantity at an offset time, using the defined derivatives.

Parameters
offsettime offset from when reference value and derivatives were defined.
Returns
the extrapolated momentary scalar value at the offset time.
See also
rate(), acceleration()

References supernovas::Interval::seconds().

Referenced by ScalarEvolution(), and stationary().