![]() |
SuperNOVAS C++ API v1.8
High-precision C/C++ astrometry library
|
A physical temperature value, which can be instantiated, and then expressed, in different commonly used temperature units (C, K, or F). More...
#include <supernovas.h>
Public Member Functions | |
| double | celsius () const |
| Returns the temperature value in degrees Celsius. | |
| bool | equals (const Temperature &temp, double precision=1e-3) const |
| Checks if this pressure value is the same as another, within the specified precision. | |
| double | fahrenheit () const |
| Returns the temperature value in degrees Fahrenheit. | |
| double | kelvin () const |
| Returns the temperature value in degrees Kelvin. | |
| bool | operator!= (const Temperature &temp) const |
| Checks if this pressure value differs from another by more than 1 mK. | |
| bool | operator== (const Temperature &temp) const |
| Checks if this pressure value is the same as another, within 1 mK. | |
| std::string | SI_unit () const override |
| std::string | to_string (int decimals=1) const override |
| Returns a human-readable string representation of this temperature value. | |
| Public Member Functions inherited from supernovas::Scalar | |
| virtual | ~Scalar () |
| bool | equals (const Scalar &other, double precision) const |
| Checks if this scalar quantity is the same as another, within the specified precision. | |
| double | SI_value () const |
| The value of this scalar quantity in S.I. | |
| Public Member Functions inherited from supernovas::Validating | |
| bool | is_valid () const |
| Returns the previously set 'valid' state 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 Temperature | celsius (double value) |
| Returns a new temperature object, with the specified temperature value defined in degrees Celsius. | |
| static Temperature | fahrenheit (double value) |
| Returns a new temperature object, with the specified temperature value defined in degrees Fahrenheit. | |
| static Temperature | kelvin (double value) |
| Returns a new temperature object, with the specified temperature value defined in degrees Kelvin. | |
Additional Inherited Members | |
| Protected Member Functions inherited from supernovas::Scalar | |
| Scalar () | |
| Instantiates a standard undefined (invalid) scalar quantity with NAN value. | |
| Scalar (double SI_value) | |
| Instantiates a scalar quantity with an initializing value in standard S.I. | |
| Protected Member Functions inherited from supernovas::Validating | |
| Validating () | |
| dummy constructor; | |
| Protected Attributes inherited from supernovas::Scalar | |
| double | _value |
| The value in S.I. units. | |
| Protected Attributes inherited from supernovas::Validating | |
| bool | _valid = false |
| the state variable. | |
A physical temperature value, which can be instantiated, and then expressed, in different commonly used temperature units (C, K, or F).
Within SuperNOVAS it is normally used to express ambient temperatures at an observing location, but users may utilize it in any other context also.
| double supernovas::Temperature::celsius | ( | ) | const |
Returns the temperature value in degrees Celsius.
References supernovas::Scalar::_value, and celsius().
Referenced by celsius(), celsius(), fahrenheit(), and to_string().
|
static |
Returns a new temperature object, with the specified temperature value defined in degrees Celsius.
| value | [C] temperature value |
References celsius(), and supernovas::Validating::is_valid().
| bool supernovas::Temperature::equals | ( | const Temperature & | temp, |
| double | precision = 1e-3 ) const |
Checks if this pressure value is the same as another, within the specified precision.
| temp | Another temperature value. |
| precision | [K] (optional) Precision for the comparison (default: 1 mK). |
References supernovas::Scalar::equals(), and equals().
Referenced by equals(), and operator==().
| double supernovas::Temperature::fahrenheit | ( | ) | const |
Returns the temperature value in degrees Fahrenheit.
References celsius(), and fahrenheit().
Referenced by fahrenheit(), and fahrenheit().
|
static |
Returns a new temperature object, with the specified temperature value defined in degrees Fahrenheit.
| value | [F] temperature value |
References fahrenheit(), and supernovas::Validating::is_valid().
| double supernovas::Temperature::kelvin | ( | ) | const |
Returns the temperature value in degrees Kelvin.
References supernovas::Scalar::_value, and kelvin().
|
static |
Returns a new temperature object, with the specified temperature value defined in degrees Kelvin.
| value | [K] temperature value |
References supernovas::Validating::is_valid(), and kelvin().
| bool supernovas::Temperature::operator!= | ( | const Temperature & | temp | ) | const |
Checks if this pressure value differs from another by more than 1 mK.
| temp | Another temperature value. |
References operator!=().
Referenced by operator!=().
| bool supernovas::Temperature::operator== | ( | const Temperature & | temp | ) | const |
Checks if this pressure value is the same as another, within 1 mK.
| temp | Another temperature value. |
References equals(), and operator==().
Referenced by operator==().
|
overridevirtual |
|
overridevirtual |
Returns a human-readable string representation of this temperature value.
| decimals | (optional) [0:16] decimal places to print (default: 3). |
Reimplemented from supernovas::Scalar.
References celsius(), and to_string().
Referenced by to_string().