Physical Quantities  v1.0.0
C++ library of physical quantities, physical models, and units of measure for scientific computing. https://github.com/acodcha/phq
Public Member Functions | Static Public Member Functions | Protected Attributes | Private Member Functions | List of all members
PhQ::SolidAngle< NumericType > Class Template Reference

Solid angle. Measures the field of view of a portion of the surface of the unit sphere viewed from the center of the unit sphere. Typically measured in steradians (sr), which are square radians. The unit sphere has a total solid angle of 4π steradians. More...

#include "SolidAngle.hpp"

Public Member Functions

 SolidAngle ()=default
 Default constructor. Constructs a solid angle with an uninitialized value. More...
 
 SolidAngle (const NumericType value, const Unit::SolidAngle unit)
 Constructor. Constructs a solid angle with a given value expressed in a given solid angle unit. More...
 
 ~SolidAngle () noexcept=default
 Destructor. Destroys this solid angle. More...
 
constexpr SolidAngle (const SolidAngle< NumericType > &other)=default
 Copy constructor. Constructs a solid angle by copying another one. More...
 
template<typename OtherNumericType >
constexpr SolidAngle (const SolidAngle< OtherNumericType > &other)
 Copy constructor. Constructs a solid angle by copying another one. More...
 
constexpr SolidAngle (SolidAngle< NumericType > &&other) noexcept=default
 Move constructor. Constructs a solid angle by moving another one. More...
 
constexpr SolidAngle< NumericType > & operator= (const SolidAngle< NumericType > &other)=default
 Copy assignment operator. Assigns this solid angle by copying another one. More...
 
template<typename OtherNumericType >
constexpr SolidAngle< NumericType > & operator= (const SolidAngle< OtherNumericType > &other)
 Copy assignment operator. Assigns this solid angle by copying another one. More...
 
constexpr SolidAngle< NumericType > & operator= (SolidAngle< NumericType > &&other) noexcept=default
 Move assignment operator. Assigns this solid angle by moving another one. More...
 
constexpr SolidAngle< NumericType > operator+ (const SolidAngle< NumericType > &other) const
 
constexpr SolidAngle< NumericType > operator- (const SolidAngle< NumericType > &other) const
 
constexpr SolidAngle< NumericType > operator* (const NumericType number) const
 
constexpr SolidAngle< NumericType > operator/ (const NumericType number) const
 
constexpr NumericType operator/ (const SolidAngle< NumericType > &other) const noexcept
 
constexpr void operator+= (const SolidAngle< NumericType > &other) noexcept
 
constexpr void operator-= (const SolidAngle< NumericType > &other) noexcept
 
constexpr void operator*= (const NumericType number) noexcept
 
constexpr void operator/= (const NumericType number) noexcept
 
constexpr double Value () const noexcept
 Value of this physical quantity expressed in its standard unit of measure. More...
 
double Value (const Unit::SolidAngle unit) const
 Value of this physical quantity expressed in a given unit of measure. More...
 
constexpr double StaticValue () const
 Value of this physical quantity expressed in a given unit of measure. This method can be evaluated statically at compile-time. More...
 
constexpr double & MutableValue () noexcept
 Returns the value of this physical quantity expressed in its standard unit of measure as a mutable value. More...
 
constexpr void SetValue (const double value) noexcept
 Sets the value of this physical quantity expressed in its standard unit of measure to the given value. More...
 
std::string Print () const
 Prints this physical quantity as a string. This physical quantity's value is expressed in its standard unit of measure. More...
 
std::string Print (const Unit::SolidAngle unit) const
 Prints this physical quantity as a string. This physical quantity's value is expressed in the given unit of measure. More...
 
std::string JSON () const
 Serializes this physical quantity as a JSON message. This physical quantity's value is expressed in its standard unit of measure. More...
 
std::string JSON (const Unit::SolidAngle unit) const
 Serializes this physical quantity as a JSON message. This physical quantity's value is expressed in the given unit of measure. More...
 
std::string XML () const
 Serializes this physical quantity as an XML message. This physical quantity's value is expressed in its standard unit of measure. More...
 
std::string XML (const Unit::SolidAngle unit) const
 Serializes this physical quantity as an XML message. This physical quantity's value is expressed in the given unit of measure. More...
 
std::string YAML () const
 Serializes this physical quantity as a YAML message. This physical quantity's value is expressed in its standard unit of measure. More...
 
std::string YAML (const Unit::SolidAngle unit) const
 Serializes this physical quantity as a YAML message. This physical quantity's value is expressed in the given unit of measure. More...
 

Static Public Member Functions

static constexpr SolidAngle< NumericType > Zero ()
 Statically creates a solid angle of zero. More...
 
template<Unit::SolidAngle Unit>
static constexpr SolidAngle< NumericType > Create (const NumericType value)
 Statically creates a solid angle with a given value expressed in a given solid angle unit. More...
 
static constexpr const PhQ::DimensionsDimensions ()
 Physical dimension set of this physical quantity. More...
 
static constexpr Unit::SolidAngle Unit ()
 Standard unit of measure for this physical quantity. This physical quantity's value is stored internally in this unit of measure. More...
 

Protected Attributes

double value
 Value of this physical quantity expressed in its standard unit of measure. More...
 

Private Member Functions

constexpr SolidAngle (const NumericType value)
 Constructor. Constructs a solid angle with a given value expressed in the standard solid angle unit. More...
 

Detailed Description

template<typename NumericType = double>
class PhQ::SolidAngle< NumericType >

Solid angle. Measures the field of view of a portion of the surface of the unit sphere viewed from the center of the unit sphere. Typically measured in steradians (sr), which are square radians. The unit sphere has a total solid angle of 4π steradians.

Definition at line 42 of file SolidAngle.hpp.

Constructor & Destructor Documentation

◆ SolidAngle() [1/6]

template<typename NumericType = double>
PhQ::SolidAngle< NumericType >::SolidAngle ( )
default

Default constructor. Constructs a solid angle with an uninitialized value.

◆ SolidAngle() [2/6]

template<typename NumericType = double>
PhQ::SolidAngle< NumericType >::SolidAngle ( const NumericType  value,
const Unit::SolidAngle< NumericType >  unit 
)
inline

Constructor. Constructs a solid angle with a given value expressed in a given solid angle unit.

Definition at line 49 of file SolidAngle.hpp.

◆ ~SolidAngle()

template<typename NumericType = double>
PhQ::SolidAngle< NumericType >::~SolidAngle ( )
defaultnoexcept

Destructor. Destroys this solid angle.

◆ SolidAngle() [3/6]

template<typename NumericType = double>
constexpr PhQ::SolidAngle< NumericType >::SolidAngle ( const SolidAngle< NumericType > &  other)
constexprdefault

Copy constructor. Constructs a solid angle by copying another one.

◆ SolidAngle() [4/6]

template<typename NumericType = double>
template<typename OtherNumericType >
constexpr PhQ::SolidAngle< NumericType >::SolidAngle ( const SolidAngle< OtherNumericType > &  other)
inlineexplicitconstexpr

Copy constructor. Constructs a solid angle by copying another one.

Definition at line 60 of file SolidAngle.hpp.

◆ SolidAngle() [5/6]

template<typename NumericType = double>
constexpr PhQ::SolidAngle< NumericType >::SolidAngle ( SolidAngle< NumericType > &&  other)
constexprdefaultnoexcept

Move constructor. Constructs a solid angle by moving another one.

◆ SolidAngle() [6/6]

template<typename NumericType = double>
constexpr PhQ::SolidAngle< NumericType >::SolidAngle ( const NumericType  value)
inlineexplicitconstexprprivate

Constructor. Constructs a solid angle with a given value expressed in the standard solid angle unit.

Definition at line 131 of file SolidAngle.hpp.

Member Function Documentation

◆ Create()

template<typename NumericType = double>
template<Unit::SolidAngle Unit>
static constexpr SolidAngle<NumericType> PhQ::SolidAngle< NumericType >::Create ( const NumericType  value)
inlinestaticconstexpr

Statically creates a solid angle with a given value expressed in a given solid angle unit.

Definition at line 87 of file SolidAngle.hpp.

References PhQ::DimensionalScalar< Unit::SolidAngle, double >::value.

◆ Dimensions()

static constexpr const PhQ::Dimensions& PhQ::DimensionalScalar< Unit::SolidAngle , double >::Dimensions ( )
inlinestaticconstexprinherited

Physical dimension set of this physical quantity.

Definition at line 54 of file DimensionalScalar.hpp.

◆ JSON() [1/2]

std::string PhQ::DimensionalScalar< Unit::SolidAngle , double >::JSON ( ) const
inlineinherited

Serializes this physical quantity as a JSON message. This physical quantity's value is expressed in its standard unit of measure.

Definition at line 107 of file DimensionalScalar.hpp.

◆ JSON() [2/2]

std::string PhQ::DimensionalScalar< Unit::SolidAngle , double >::JSON ( const Unit::SolidAngle  unit) const
inlineinherited

Serializes this physical quantity as a JSON message. This physical quantity's value is expressed in the given unit of measure.

Definition at line 117 of file DimensionalScalar.hpp.

◆ MutableValue()

constexpr double & PhQ::DimensionalScalar< Unit::SolidAngle , double >::MutableValue ( )
inlineconstexprnoexceptinherited

Returns the value of this physical quantity expressed in its standard unit of measure as a mutable value.

Definition at line 83 of file DimensionalScalar.hpp.

◆ operator*()

template<typename NumericType = double>
constexpr SolidAngle<NumericType> PhQ::SolidAngle< NumericType >::operator* ( const NumericType  number) const
inlineconstexpr

◆ operator*=()

template<typename NumericType = double>
constexpr void PhQ::SolidAngle< NumericType >::operator*= ( const NumericType  number)
inlineconstexprnoexcept

◆ operator+()

template<typename NumericType = double>
constexpr SolidAngle<NumericType> PhQ::SolidAngle< NumericType >::operator+ ( const SolidAngle< NumericType > &  other) const
inlineconstexpr

◆ operator+=()

template<typename NumericType = double>
constexpr void PhQ::SolidAngle< NumericType >::operator+= ( const SolidAngle< NumericType > &  other)
inlineconstexprnoexcept

◆ operator-()

template<typename NumericType = double>
constexpr SolidAngle<NumericType> PhQ::SolidAngle< NumericType >::operator- ( const SolidAngle< NumericType > &  other) const
inlineconstexpr

◆ operator-=()

template<typename NumericType = double>
constexpr void PhQ::SolidAngle< NumericType >::operator-= ( const SolidAngle< NumericType > &  other)
inlineconstexprnoexcept

◆ operator/() [1/2]

template<typename NumericType = double>
constexpr SolidAngle<NumericType> PhQ::SolidAngle< NumericType >::operator/ ( const NumericType  number) const
inlineconstexpr

◆ operator/() [2/2]

template<typename NumericType = double>
constexpr NumericType PhQ::SolidAngle< NumericType >::operator/ ( const SolidAngle< NumericType > &  other) const
inlineconstexprnoexcept

◆ operator/=()

template<typename NumericType = double>
constexpr void PhQ::SolidAngle< NumericType >::operator/= ( const NumericType  number)
inlineconstexprnoexcept

◆ operator=() [1/3]

template<typename NumericType = double>
constexpr SolidAngle<NumericType>& PhQ::SolidAngle< NumericType >::operator= ( const SolidAngle< NumericType > &  other)
constexprdefault

Copy assignment operator. Assigns this solid angle by copying another one.

◆ operator=() [2/3]

template<typename NumericType = double>
template<typename OtherNumericType >
constexpr SolidAngle<NumericType>& PhQ::SolidAngle< NumericType >::operator= ( const SolidAngle< OtherNumericType > &  other)
inlineconstexpr

Copy assignment operator. Assigns this solid angle by copying another one.

Definition at line 71 of file SolidAngle.hpp.

References PhQ::DimensionalScalar< UnitType, NumericType >::Value(), and PhQ::DimensionalScalar< Unit::SolidAngle, double >::value.

◆ operator=() [3/3]

template<typename NumericType = double>
constexpr SolidAngle<NumericType>& PhQ::SolidAngle< NumericType >::operator= ( SolidAngle< NumericType > &&  other)
constexprdefaultnoexcept

Move assignment operator. Assigns this solid angle by moving another one.

◆ Print() [1/2]

std::string PhQ::DimensionalScalar< Unit::SolidAngle , double >::Print ( ) const
inlineinherited

Prints this physical quantity as a string. This physical quantity's value is expressed in its standard unit of measure.

Definition at line 95 of file DimensionalScalar.hpp.

◆ Print() [2/2]

std::string PhQ::DimensionalScalar< Unit::SolidAngle , double >::Print ( const Unit::SolidAngle  unit) const
inlineinherited

Prints this physical quantity as a string. This physical quantity's value is expressed in the given unit of measure.

Definition at line 101 of file DimensionalScalar.hpp.

◆ SetValue()

constexpr void PhQ::DimensionalScalar< Unit::SolidAngle , double >::SetValue ( const double  value)
inlineconstexprnoexceptinherited

Sets the value of this physical quantity expressed in its standard unit of measure to the given value.

Definition at line 89 of file DimensionalScalar.hpp.

◆ StaticValue()

constexpr double PhQ::DimensionalScalar< Unit::SolidAngle , double >::StaticValue ( ) const
inlineconstexprinherited

Value of this physical quantity expressed in a given unit of measure. This method can be evaluated statically at compile-time.

Definition at line 77 of file DimensionalScalar.hpp.

◆ Unit()

static constexpr Unit::SolidAngle PhQ::DimensionalScalar< Unit::SolidAngle , double >::Unit ( )
inlinestaticconstexprinherited

Standard unit of measure for this physical quantity. This physical quantity's value is stored internally in this unit of measure.

Definition at line 60 of file DimensionalScalar.hpp.

◆ Value() [1/2]

constexpr double PhQ::DimensionalScalar< Unit::SolidAngle , double >::Value ( ) const
inlineconstexprnoexceptinherited

Value of this physical quantity expressed in its standard unit of measure.

Definition at line 65 of file DimensionalScalar.hpp.

◆ Value() [2/2]

double PhQ::DimensionalScalar< Unit::SolidAngle , double >::Value ( const Unit::SolidAngle  unit) const
inlineinherited

Value of this physical quantity expressed in a given unit of measure.

Definition at line 70 of file DimensionalScalar.hpp.

◆ XML() [1/2]

std::string PhQ::DimensionalScalar< Unit::SolidAngle , double >::XML ( ) const
inlineinherited

Serializes this physical quantity as an XML message. This physical quantity's value is expressed in its standard unit of measure.

Definition at line 127 of file DimensionalScalar.hpp.

◆ XML() [2/2]

std::string PhQ::DimensionalScalar< Unit::SolidAngle , double >::XML ( const Unit::SolidAngle  unit) const
inlineinherited

Serializes this physical quantity as an XML message. This physical quantity's value is expressed in the given unit of measure.

Definition at line 137 of file DimensionalScalar.hpp.

◆ YAML() [1/2]

std::string PhQ::DimensionalScalar< Unit::SolidAngle , double >::YAML ( ) const
inlineinherited

Serializes this physical quantity as a YAML message. This physical quantity's value is expressed in its standard unit of measure.

Definition at line 147 of file DimensionalScalar.hpp.

◆ YAML() [2/2]

std::string PhQ::DimensionalScalar< Unit::SolidAngle , double >::YAML ( const Unit::SolidAngle  unit) const
inlineinherited

Serializes this physical quantity as a YAML message. This physical quantity's value is expressed in the given unit of measure.

Definition at line 157 of file DimensionalScalar.hpp.

◆ Zero()

template<typename NumericType = double>
static constexpr SolidAngle<NumericType> PhQ::SolidAngle< NumericType >::Zero ( )
inlinestaticconstexpr

Statically creates a solid angle of zero.

Definition at line 80 of file SolidAngle.hpp.

Member Data Documentation

◆ value

double PhQ::DimensionalScalar< Unit::SolidAngle , double >::value
protectedinherited

Value of this physical quantity expressed in its standard unit of measure.

Definition at line 221 of file DimensionalScalar.hpp.


The documentation for this class was generated from the following file: