![]() |
SuperNOVAS C++ API v1.6
High-precision C/C++ astrometry library
|
A scalar velocity (if signed) or speed (unsigned). More...
#include <supernovas.h>
Public Member Functions | |
| ScalarVelocity (double m_per_s) | |
| Instantiates a (signed) scalar velocity (speed) with the specified S.I. | |
| ScalarVelocity | abs () const |
| Returns the magnitude of this speed, as a unsigned speed. | |
| double | au_per_day () const |
| Returns this speed in AU/day. | |
| double | beta () const |
| Returns this speed (v) as β = v / c. | |
| bool | equals (const ScalarVelocity &speed, const ScalarVelocity &tolerance) const |
| Checks if this speed equals the specified other speed within the tolerance. | |
| bool | equals (const ScalarVelocity &speed, double tolerance=Unit::mm/Unit::sec) const |
| Checks if this speed equals the specified other speed within the tolerance. | |
| double | Gamma () const |
| Returns the relativistic boost parameter Γ for this speed (v) as Γ = &radic (1 - v2 / c2). | |
| Velocity | in_direction (const Vector &direction) const |
| Returns a 3-dimensional velocity vector corresponding to this speed along the specified direction. | |
| double | km_per_s () const |
| Returns this speed in km/s. | |
| double | m_per_s () const |
| Returns this speed in m/s. | |
| bool | operator!= (const ScalarVelocity &speed) const |
| Checks if this speed differs from the specified other speed, by more than 1 mm/s. | |
| Coordinate | operator* (const Interval &time) const |
| Returns the distance travelled at this speed under the specified time interval. | |
| ScalarVelocity | operator+ (const ScalarVelocity &r) const |
| Returns the signed scalar sum of this speed and the specified other speed, using the relativistic formula for addition. | |
| ScalarVelocity | operator- (const ScalarVelocity &r) const |
| Returns the signed scalar difference of this speed and the specified other speed, using the relativistic formula for addition. | |
| bool | operator== (const ScalarVelocity &speed) const |
| Checks if this speed equals the specified other speed within 1 mm/s. | |
| ScalarVelocity | operator[] (int idx) const |
| double | redshift () const |
| Returns this speed as a redshift measure. | |
| std::string | to_string (int decimals=3) const |
| Returns a string representation of this speed in km/s with the specified decimal places shown. | |
| Coordinate | travel (const Interval &time) const |
| Returns the distance travelled at this speed under the specified time interval. | |
| Coordinate | travel (double seconds) const |
| Returns the distance travelled at this speed under the specified time interval. | |
| 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 ScalarVelocity | from_redshift (double z) |
| Instantiates a new speed instance from a given redshift value. | |
| static const ScalarVelocity & | stationary () |
| Returns a reference to a statically defined zero speed of a stationary object. | |
| static const ScalarVelocity & | undefined () |
| Returns a reference to a static instance of an undefined / invalid scalar velocity. | |
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. | |
A scalar velocity (if signed) or speed (unsigned).
|
explicit |
Instantiates a (signed) scalar velocity (speed) with the specified S.I.
value in m/s.
| m_per_s | [m/s] the speed |
References supernovas::Validating::_valid, supernovas::Constant::c, and m_per_s().
| ScalarVelocity supernovas::ScalarVelocity::abs | ( | ) | const |
Returns the magnitude of this speed, as a unsigned speed.
Returns the unsigned magnitude of this (possibly signed) speed.
References supernovas::Validating::is_valid().
| double supernovas::ScalarVelocity::au_per_day | ( | ) | const |
Returns this speed in AU/day.
References supernovas::Unit::au, and supernovas::Unit::day.
| double supernovas::ScalarVelocity::beta | ( | ) | const |
Returns this speed (v) as β = v / c.
References supernovas::Constant::c.
Referenced by Gamma(), operator+(), and operator-().
| bool supernovas::ScalarVelocity::equals | ( | const ScalarVelocity & | speed, |
| const ScalarVelocity & | tolerance ) const |
Checks if this speed equals the specified other speed within the tolerance.
| speed | the reference speed |
| tolerance | (optional) tolerance for the comparison (default: 0.001 m/s). |
| bool supernovas::ScalarVelocity::equals | ( | const ScalarVelocity & | speed, |
| double | tolerance = Unit::mm / Unit::sec ) const |
Checks if this speed equals the specified other speed within the tolerance.
| speed | the reference speed |
| tolerance | [m/s] (optional) tolerance for the comparison (default: 0.001 m/s). |
Referenced by equals(), operator!=(), and operator==().
|
static |
Instantiates a new speed instance from a given redshift value.
| z | the redshift value. |
References supernovas::Validating::is_valid(), supernovas::Unit::km, novas_z2v(), and supernovas::Unit::sec.
| double supernovas::ScalarVelocity::Gamma | ( | ) | const |
Returns the relativistic boost parameter Γ for this speed (v) as Γ = &radic (1 - v2 / c2).
References beta().
Returns a 3-dimensional velocity vector corresponding to this speed along the specified direction.
| direction | a vector specifying the direction. Its magnitude is irrelevant. |
References supernovas::Vector::_array(), supernovas::Vector::abs(), and supernovas::Validating::is_valid().
| double supernovas::ScalarVelocity::km_per_s | ( | ) | const |
Returns this speed in km/s.
Referenced by supernovas::GeodeticObserver::GeodeticObserver(), redshift(), and to_string().
| double supernovas::ScalarVelocity::m_per_s | ( | ) | const |
Returns this speed in m/s.
Referenced by ScalarVelocity(), equals(), supernovas::Apparent::from_cirs(), supernovas::Apparent::from_tod(), supernovas::CatalogEntry::radial_velocity(), supernovas::Horizontal::to_apparent(), and supernovas::CatalogEntry::v_lsr().
| bool supernovas::ScalarVelocity::operator!= | ( | const ScalarVelocity & | speed | ) | const |
Checks if this speed differs from the specified other speed, by more than 1 mm/s.
| speed | the reference speed |
References equals().
| Coordinate supernovas::ScalarVelocity::operator* | ( | const Interval & | time | ) | const |
Returns the distance travelled at this speed under the specified time interval.
| Time of observation and astronomical timescales | the time interval |
References supernovas::Validating::is_valid(), and travel().
| ScalarVelocity supernovas::ScalarVelocity::operator+ | ( | const ScalarVelocity & | r | ) | const |
Returns the signed scalar sum of this speed and the specified other speed, using the relativistic formula for addition.
| r | the speed on the right-hand side |
References beta(), supernovas::Constant::c, and supernovas::Validating::is_valid().
| ScalarVelocity supernovas::ScalarVelocity::operator- | ( | const ScalarVelocity & | r | ) | const |
Returns the signed scalar difference of this speed and the specified other speed, using the relativistic formula for addition.
| r | the speed on the right-hand side |
References beta(), supernovas::Constant::c, and supernovas::Validating::is_valid().
| bool supernovas::ScalarVelocity::operator== | ( | const ScalarVelocity & | speed | ) | const |
Checks if this speed equals the specified other speed within 1 mm/s.
| speed | the reference speed |
References equals().
| ScalarVelocity supernovas::ScalarVelocity::operator[] | ( | int | idx | ) | const |
| double supernovas::ScalarVelocity::redshift | ( | ) | const |
Returns this speed as a redshift measure.
References km_per_s(), and novas_v2z().
|
static |
Returns a reference to a statically defined zero speed of a stationary object.
| std::string supernovas::ScalarVelocity::to_string | ( | int | decimals = 3 | ) | const |
Returns a string representation of this speed in km/s with the specified decimal places shown.
| decimals | (optional) the number of decimal places to print (default: 3) |
References km_per_s().
Referenced by supernovas::CatalogEntry::to_string(), and supernovas::Velocity::to_string().
| Coordinate supernovas::ScalarVelocity::travel | ( | const Interval & | time | ) | const |
Returns the distance travelled at this speed under the specified time interval.
| Time of observation and astronomical timescales | the time interval |
References supernovas::Interval::seconds(), and travel().
| Coordinate supernovas::ScalarVelocity::travel | ( | double | seconds | ) | const |
Returns the distance travelled at this speed under the specified time interval.
| seconds | [s] the time interval |
References supernovas::Validating::is_valid().
Referenced by supernovas::Interval::operator*(), operator*(), and travel().
|
static |
Returns a reference to a static instance of an undefined / invalid scalar velocity.
Referenced by supernovas::Track< CoordType >::radial_velocity_at().