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 | Friends | List of all members
PhQ::ScalarAcceleration< NumericType > Class Template Reference

Scalar acceleration component or magnitude of an acceleration vector. For a three-dimensional Euclidean acceleration vector, see PhQ::Acceleration. For a two-dimensional Euclidean acceleration vector in the XY plane, see PhQ::PlanarAcceleration. More...

#include "ScalarAcceleration.hpp"

Public Member Functions

 ScalarAcceleration ()=default
 Default constructor. Constructs a scalar acceleration with an uninitialized value. More...
 
 ScalarAcceleration (const NumericType value, const Unit::Acceleration unit)
 Constructor. Constructs a scalar acceleration with a given value expressed in a given acceleration unit. More...
 
constexpr ScalarAcceleration (const Speed< NumericType > &speed, const Time< NumericType > &time)
 Constructor. Constructs a scalar acceleration from a given speed and time using the definition of acceleration. More...
 
constexpr ScalarAcceleration (const Speed< NumericType > &speed, const Frequency< NumericType > &frequency)
 Constructor. Constructs a scalar acceleration from a given speed and frequency using the definition of acceleration. More...
 
 ~ScalarAcceleration () noexcept=default
 Destructor. Destroys this acceleration scalar. More...
 
constexpr ScalarAcceleration (const ScalarAcceleration< NumericType > &other)=default
 Copy constructor. Constructs a scalar acceleration by copying another one. More...
 
template<typename OtherNumericType >
constexpr ScalarAcceleration (const ScalarAcceleration< OtherNumericType > &other)
 Copy constructor. Constructs a scalar acceleration by copying another one. More...
 
constexpr ScalarAcceleration (ScalarAcceleration< NumericType > &&other) noexcept=default
 Move constructor. Constructs a scalar acceleration by moving another one. More...
 
constexpr ScalarAcceleration< NumericType > & operator= (const ScalarAcceleration< NumericType > &other)=default
 Copy assignment operator. Assigns this scalar acceleration by copying another one. More...
 
template<typename OtherNumericType >
constexpr ScalarAcceleration< NumericType > & operator= (const ScalarAcceleration< OtherNumericType > &other)
 Copy assignment operator. Assigns this scalar acceleration by copying another one. More...
 
constexpr ScalarAcceleration< NumericType > & operator= (ScalarAcceleration< NumericType > &&other) noexcept=default
 Move assignment operator. Assigns this scalar acceleration by moving another one. More...
 
constexpr ScalarAcceleration< NumericType > operator+ (const ScalarAcceleration< NumericType > &scalar_acceleration) const
 
constexpr ScalarAcceleration< NumericType > operator- (const ScalarAcceleration< NumericType > &scalar_acceleration) const
 
constexpr ScalarAcceleration< NumericType > operator* (const NumericType number) const
 
constexpr Speed< NumericType > operator* (const Time< NumericType > &time) const
 
constexpr PlanarAcceleration< NumericType > operator* (const PlanarDirection< NumericType > &planar_direction) const
 
constexpr Acceleration< NumericType > operator* (const Direction< NumericType > &direction) const
 
constexpr ScalarAcceleration< NumericType > operator/ (const NumericType number) const
 
constexpr Speed< NumericType > operator/ (const Frequency< NumericType > &frequency) const
 
constexpr Frequency< NumericType > operator/ (const Speed< NumericType > &speed) const
 
constexpr NumericType operator/ (const ScalarAcceleration< NumericType > &scalar_acceleration) const noexcept
 
constexpr void operator+= (const ScalarAcceleration< NumericType > &scalar_acceleration) noexcept
 
constexpr void operator-= (const ScalarAcceleration< NumericType > &scalar_acceleration) 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::Acceleration 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::Acceleration 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::Acceleration 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::Acceleration 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::Acceleration 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 ScalarAcceleration< NumericType > Zero ()
 Statically creates a scalar acceleration of zero. More...
 
template<Unit::Acceleration Unit>
static constexpr ScalarAcceleration< NumericType > Create (const NumericType value)
 Statically creates a scalar acceleration with a given value expressed in a given acceleration unit. More...
 
static constexpr const PhQ::DimensionsDimensions ()
 Physical dimension set of this physical quantity. More...
 
static constexpr Unit::Acceleration 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 ScalarAcceleration (const NumericType value)
 Constructor. Constructs a scalar acceleration with a given value expressed in the standard acceleration unit. More...
 

Friends

template<typename OtherNumericType >
class PlanarAcceleration
 
template<typename OtherNumericType >
class Acceleration
 Acceleration units. More...
 

Detailed Description

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

Scalar acceleration component or magnitude of an acceleration vector. For a three-dimensional Euclidean acceleration vector, see PhQ::Acceleration. For a two-dimensional Euclidean acceleration vector in the XY plane, see PhQ::PlanarAcceleration.

Definition at line 60 of file ScalarAcceleration.hpp.

Constructor & Destructor Documentation

◆ ScalarAcceleration() [1/8]

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

Default constructor. Constructs a scalar acceleration with an uninitialized value.

◆ ScalarAcceleration() [2/8]

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

Constructor. Constructs a scalar acceleration with a given value expressed in a given acceleration unit.

Definition at line 67 of file ScalarAcceleration.hpp.

◆ ScalarAcceleration() [3/8]

template<typename NumericType = double>
constexpr PhQ::ScalarAcceleration< NumericType >::ScalarAcceleration ( const Speed< NumericType > &  speed,
const Time< NumericType > &  time 
)
inlineconstexpr

Constructor. Constructs a scalar acceleration from a given speed and time using the definition of acceleration.

Definition at line 72 of file ScalarAcceleration.hpp.

◆ ScalarAcceleration() [4/8]

template<typename NumericType = double>
constexpr PhQ::ScalarAcceleration< NumericType >::ScalarAcceleration ( const Speed< NumericType > &  speed,
const Frequency< NumericType > &  frequency 
)
inlineconstexpr

Constructor. Constructs a scalar acceleration from a given speed and frequency using the definition of acceleration.

Definition at line 77 of file ScalarAcceleration.hpp.

◆ ~ScalarAcceleration()

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

Destructor. Destroys this acceleration scalar.

◆ ScalarAcceleration() [5/8]

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

Copy constructor. Constructs a scalar acceleration by copying another one.

◆ ScalarAcceleration() [6/8]

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

Copy constructor. Constructs a scalar acceleration by copying another one.

Definition at line 89 of file ScalarAcceleration.hpp.

◆ ScalarAcceleration() [7/8]

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

Move constructor. Constructs a scalar acceleration by moving another one.

◆ ScalarAcceleration() [8/8]

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

Constructor. Constructs a scalar acceleration with a given value expressed in the standard acceleration unit.

Definition at line 183 of file ScalarAcceleration.hpp.

Member Function Documentation

◆ Create()

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

Statically creates a scalar acceleration with a given value expressed in a given acceleration unit.

Definition at line 119 of file ScalarAcceleration.hpp.

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

◆ Dimensions()

static constexpr const PhQ::Dimensions& PhQ::DimensionalScalar< Unit::Acceleration , 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::Acceleration , 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::Acceleration , double >::JSON ( const Unit::Acceleration  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::Acceleration , 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*() [1/4]

template<typename NumericType >
constexpr Acceleration< NumericType > PhQ::ScalarAcceleration< NumericType >::operator* ( const Direction< NumericType > &  direction) const
inlineconstexpr

Definition at line 314 of file Acceleration.hpp.

◆ operator*() [2/4]

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

◆ operator*() [3/4]

template<typename NumericType >
constexpr PlanarAcceleration< NumericType > PhQ::ScalarAcceleration< NumericType >::operator* ( const PlanarDirection< NumericType > &  planar_direction) const
inlineconstexpr

Definition at line 310 of file PlanarAcceleration.hpp.

◆ operator*() [4/4]

template<typename NumericType = double>
constexpr Speed<NumericType> PhQ::ScalarAcceleration< NumericType >::operator* ( const Time< NumericType > &  time) const
inlineconstexpr

Definition at line 138 of file ScalarAcceleration.hpp.

◆ operator*=()

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

◆ operator+()

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

◆ operator+=()

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

◆ operator-()

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

◆ operator-=()

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

◆ operator/() [1/4]

template<typename NumericType = double>
constexpr Speed<NumericType> PhQ::ScalarAcceleration< NumericType >::operator/ ( const Frequency< NumericType > &  frequency) const
inlineconstexpr

Definition at line 151 of file ScalarAcceleration.hpp.

◆ operator/() [2/4]

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

◆ operator/() [3/4]

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

◆ operator/() [4/4]

template<typename NumericType = double>
constexpr Frequency<NumericType> PhQ::ScalarAcceleration< NumericType >::operator/ ( const Speed< NumericType > &  speed) const
inlineconstexpr

Definition at line 155 of file ScalarAcceleration.hpp.

◆ operator/=()

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

◆ operator=() [1/3]

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

Copy assignment operator. Assigns this scalar acceleration by copying another one.

◆ operator=() [2/3]

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

Copy assignment operator. Assigns this scalar acceleration by copying another one.

Definition at line 101 of file ScalarAcceleration.hpp.

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

◆ operator=() [3/3]

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

Move assignment operator. Assigns this scalar acceleration by moving another one.

◆ Print() [1/2]

std::string PhQ::DimensionalScalar< Unit::Acceleration , 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::Acceleration , double >::Print ( const Unit::Acceleration  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::Acceleration , 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::Acceleration , 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::Acceleration PhQ::DimensionalScalar< Unit::Acceleration , 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::Acceleration , 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::Acceleration , double >::Value ( const Unit::Acceleration  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::Acceleration , 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::Acceleration , double >::XML ( const Unit::Acceleration  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::Acceleration , 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::Acceleration , double >::YAML ( const Unit::Acceleration  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 ScalarAcceleration<NumericType> PhQ::ScalarAcceleration< NumericType >::Zero ( )
inlinestaticconstexpr

Statically creates a scalar acceleration of zero.

Definition at line 112 of file ScalarAcceleration.hpp.

Friends And Related Function Documentation

◆ Acceleration

template<typename NumericType = double>
template<typename OtherNumericType >
friend class Acceleration
friend

Acceleration units.

Definition at line 190 of file ScalarAcceleration.hpp.

◆ PlanarAcceleration

template<typename NumericType = double>
template<typename OtherNumericType >
friend class PlanarAcceleration
friend

Definition at line 187 of file ScalarAcceleration.hpp.

Member Data Documentation

◆ value

double PhQ::DimensionalScalar< Unit::Acceleration , 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 files: