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::PlanarForce< NumericType > Class Template Reference

Two-dimensional Euclidean force vector in the XY plane. Contains two components in Cartesian coordinates: x and y. For a three-dimensional Euclidean force vector, see PhQ::Force. For scalar force components or for the magnitude of a force vector, see PhQ::ScalarForce. More...

#include "PlanarForce.hpp"

Public Member Functions

 PlanarForce ()=default
 Default constructor. Constructs a planar force vector with an uninitialized value. More...
 
 PlanarForce (const PlanarVector< NumericType > &value, const Unit::Force unit)
 Constructor. Constructs a planar force vector with a given value expressed in a given force unit. More...
 
 PlanarForce (const ScalarForce< NumericType > &x, const ScalarForce< NumericType > &y)
 Constructor. Constructs a planar force vector from a given set of scalar force components. More...
 
constexpr PlanarForce (const ScalarForce< NumericType > &scalar_force, const PlanarDirection< NumericType > &planar_direction)
 Constructor. Constructs a planar force vector from a given scalar force magnitude and planar direction. More...
 
constexpr PlanarForce (const Force< NumericType > &force)
 Constructor. Constructs a planar force vector from a given force vector by projecting the force vector onto the XY plane. More...
 
constexpr PlanarForce (const PlanarTraction< NumericType > &planar_traction, const Area< NumericType > &area)
 Constructor. Constructs a planar force vector from a given planar traction and area using the definition of traction. More...
 
 ~PlanarForce () noexcept=default
 Destructor. Destroys this planar force vector. More...
 
constexpr PlanarForce (const PlanarForce< NumericType > &other)=default
 Copy constructor. Constructs a planar force vector by copying another one. More...
 
template<typename OtherNumericType >
constexpr PlanarForce (const PlanarForce< OtherNumericType > &other)
 Copy constructor. Constructs a planar force vector by copying another one. More...
 
constexpr PlanarForce (PlanarForce< NumericType > &&other) noexcept=default
 Move constructor. Constructs a planar force vector by moving another one. More...
 
constexpr PlanarForce< NumericType > & operator= (const PlanarForce< NumericType > &other)=default
 Copy assignment operator. Assigns this planar force vector by copying another one. More...
 
template<typename OtherNumericType >
constexpr PlanarForce< NumericType > & operator= (const PlanarForce< OtherNumericType > &other)
 Copy assignment operator. Assigns this planar force vector by copying another one. More...
 
constexpr PlanarForce< NumericType > & operator= (PlanarForce< NumericType > &&other) noexcept=default
 Move assignment operator. Assigns this planar force vector by moving another one. More...
 
constexpr ScalarForce< NumericType > x () const noexcept
 Returns the x Cartesian component of this planar force vector. More...
 
constexpr ScalarForce< NumericType > y () const noexcept
 Returns the y Cartesian component of this planar force vector. More...
 
ScalarForce< NumericType > Magnitude () const
 Returns the magnitude of this planar force vector. More...
 
PhQ::PlanarDirection< NumericType > PlanarDirection () const
 Returns the planar direction of this planar force vector. More...
 
PhQ::Angle< NumericType > Angle (const PlanarForce< NumericType > &planar_force) const
 Returns the angle between this planar force vector and another one. More...
 
constexpr PlanarForce< NumericType > operator+ (const PlanarForce< NumericType > &planar_force) const
 
constexpr PlanarForce< NumericType > operator- (const PlanarForce< NumericType > &planar_force) const
 
constexpr PlanarForce< NumericType > operator* (const NumericType number) const
 
constexpr PlanarForce< NumericType > operator/ (const NumericType number) const
 
constexpr PlanarTraction< NumericType > operator/ (const Area< NumericType > &area) const
 
constexpr void operator+= (const PlanarForce< NumericType > &planar_force) noexcept
 
constexpr void operator-= (const PlanarForce< NumericType > &planar_force) noexcept
 
constexpr void operator*= (const NumericType number) noexcept
 
constexpr void operator/= (const NumericType number) noexcept
 
constexpr const PhQ::PlanarVector< double > & Value () const noexcept
 Value of this physical quantity expressed in its standard unit of measure. More...
 
PhQ::PlanarVector< double > Value (const Unit::Force unit) const
 Value of this physical quantity expressed in a given unit of measure. More...
 
constexpr PhQ::PlanarVector< 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 PhQ::PlanarVector< 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 PhQ::PlanarVector< 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::Force 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::Force 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::Force 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::Force 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 PlanarForce< NumericType > Zero ()
 Statically creates a planar force vector of zero. More...
 
template<Unit::Force Unit>
static constexpr PlanarForce< NumericType > Create (const NumericType x, const NumericType y)
 Statically creates a planar force vector from the given x and y Cartesian components expressed in a given force unit. More...
 
template<Unit::Force Unit>
static constexpr PlanarForce< NumericType > Create (const std::array< NumericType, 2 > &x_y)
 Statically creates a planar force vector from the given x and y Cartesian components expressed in a given force unit. More...
 
template<Unit::Force Unit>
static constexpr PlanarForce< NumericType > Create (const PlanarVector< NumericType > &value)
 Statically creates a planar force vector with a given value expressed in a given force unit. More...
 
static constexpr const PhQ::DimensionsDimensions ()
 Physical dimension set of this physical quantity. More...
 
static constexpr Unit::Force 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

PhQ::PlanarVector< double > value
 Value of this physical quantity expressed in its standard unit of measure. More...
 

Private Member Functions

constexpr PlanarForce (const PlanarVector< NumericType > &value)
 Constructor. Constructs a planar force vector with a given value expressed in the standard force unit. More...
 

Detailed Description

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

Two-dimensional Euclidean force vector in the XY plane. Contains two components in Cartesian coordinates: x and y. For a three-dimensional Euclidean force vector, see PhQ::Force. For scalar force components or for the magnitude of a force vector, see PhQ::ScalarForce.

Definition at line 50 of file PlanarForce.hpp.

Constructor & Destructor Documentation

◆ PlanarForce() [1/10]

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

Default constructor. Constructs a planar force vector with an uninitialized value.

◆ PlanarForce() [2/10]

template<typename NumericType = double>
PhQ::PlanarForce< NumericType >::PlanarForce ( const PlanarVector< NumericType > &  value,
const Unit::Force  unit 
)
inline

Constructor. Constructs a planar force vector with a given value expressed in a given force unit.

Definition at line 57 of file PlanarForce.hpp.

◆ PlanarForce() [3/10]

template<typename NumericType = double>
PhQ::PlanarForce< NumericType >::PlanarForce ( const ScalarForce< NumericType > &  x,
const ScalarForce< NumericType > &  y 
)
inline

Constructor. Constructs a planar force vector from a given set of scalar force components.

Definition at line 62 of file PlanarForce.hpp.

References PhQ::PlanarForce< NumericType >::x(), and PhQ::PlanarForce< NumericType >::y().

◆ PlanarForce() [4/10]

template<typename NumericType = double>
constexpr PhQ::PlanarForce< NumericType >::PlanarForce ( const ScalarForce< NumericType > &  scalar_force,
const PlanarDirection< NumericType > &  planar_direction 
)
inlineconstexpr

Constructor. Constructs a planar force vector from a given scalar force magnitude and planar direction.

Definition at line 67 of file PlanarForce.hpp.

◆ PlanarForce() [5/10]

template<typename NumericType >
constexpr PhQ::PlanarForce< NumericType >::PlanarForce ( const Force< NumericType > &  force)
inlineexplicitconstexpr

Constructor. Constructs a planar force vector from a given force vector by projecting the force vector onto the XY plane.

Definition at line 278 of file Force.hpp.

References PhQ::DimensionalVector< UnitType, NumericType >::Value().

◆ PlanarForce() [6/10]

template<typename NumericType >
constexpr PhQ::PlanarForce< NumericType >::PlanarForce ( const PlanarTraction< NumericType > &  planar_traction,
const Area< NumericType > &  area 
)
inlineconstexpr

Constructor. Constructs a planar force vector from a given planar traction and area using the definition of traction.

Definition at line 283 of file PlanarTraction.hpp.

◆ ~PlanarForce()

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

Destructor. Destroys this planar force vector.

◆ PlanarForce() [7/10]

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

Copy constructor. Constructs a planar force vector by copying another one.

◆ PlanarForce() [8/10]

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

Copy constructor. Constructs a planar force vector by copying another one.

Definition at line 88 of file PlanarForce.hpp.

◆ PlanarForce() [9/10]

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

Move constructor. Constructs a planar force vector by moving another one.

◆ PlanarForce() [10/10]

template<typename NumericType = double>
constexpr PhQ::PlanarForce< NumericType >::PlanarForce ( const PlanarVector< NumericType > &  value)
inlineexplicitconstexprprivate

Constructor. Constructs a planar force vector with a given value expressed in the standard force unit.

Definition at line 202 of file PlanarForce.hpp.

Member Function Documentation

◆ Angle()

template<typename NumericType = double>
PhQ::Angle<NumericType> PhQ::PlanarForce< NumericType >::Angle ( const PlanarForce< NumericType > &  planar_force) const
inline

Returns the angle between this planar force vector and another one.

Definition at line 161 of file PlanarForce.hpp.

◆ Create() [1/3]

template<typename NumericType = double>
template<Unit::Force Unit>
static constexpr PlanarForce<NumericType> PhQ::PlanarForce< NumericType >::Create ( const NumericType  x,
const NumericType  y 
)
inlinestaticconstexpr

Statically creates a planar force vector from the given x and y Cartesian components expressed in a given force unit.

Definition at line 116 of file PlanarForce.hpp.

References PhQ::PlanarForce< NumericType >::x(), and PhQ::PlanarForce< NumericType >::y().

◆ Create() [2/3]

template<typename NumericType = double>
template<Unit::Force Unit>
static constexpr PlanarForce<NumericType> PhQ::PlanarForce< NumericType >::Create ( const PlanarVector< NumericType > &  value)
inlinestaticconstexpr

Statically creates a planar force vector with a given value expressed in a given force unit.

Definition at line 134 of file PlanarForce.hpp.

References PhQ::DimensionalPlanarVector< Unit::Force, double >::value.

◆ Create() [3/3]

template<typename NumericType = double>
template<Unit::Force Unit>
static constexpr PlanarForce<NumericType> PhQ::PlanarForce< NumericType >::Create ( const std::array< NumericType, 2 > &  x_y)
inlinestaticconstexpr

Statically creates a planar force vector from the given x and y Cartesian components expressed in a given force unit.

Definition at line 125 of file PlanarForce.hpp.

◆ Dimensions()

static constexpr const PhQ::Dimensions& PhQ::DimensionalPlanarVector< Unit::Force , double >::Dimensions ( )
inlinestaticconstexprinherited

Physical dimension set of this physical quantity.

Definition at line 50 of file DimensionalPlanarVector.hpp.

◆ JSON() [1/2]

std::string PhQ::DimensionalPlanarVector< Unit::Force , 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 103 of file DimensionalPlanarVector.hpp.

◆ JSON() [2/2]

std::string PhQ::DimensionalPlanarVector< Unit::Force , double >::JSON ( const Unit::Force  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 113 of file DimensionalPlanarVector.hpp.

◆ Magnitude()

template<typename NumericType = double>
ScalarForce<NumericType> PhQ::PlanarForce< NumericType >::Magnitude ( ) const
inline

Returns the magnitude of this planar force vector.

Definition at line 151 of file PlanarForce.hpp.

References PhQ::PlanarVector< NumericType >::Magnitude(), and PhQ::DimensionalPlanarVector< Unit::Force, double >::value.

◆ MutableValue()

constexpr PhQ::PlanarVector<double >& PhQ::DimensionalPlanarVector< Unit::Force , double >::MutableValue ( )
inlineconstexprnoexceptinherited

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

Definition at line 79 of file DimensionalPlanarVector.hpp.

◆ operator*()

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

◆ operator*=()

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

◆ operator+()

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

◆ operator+=()

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

◆ operator-()

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

◆ operator-=()

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

◆ operator/() [1/2]

template<typename NumericType >
constexpr PlanarTraction< NumericType > PhQ::PlanarForce< NumericType >::operator/ ( const Area< NumericType > &  area) const
inlineconstexpr

Definition at line 300 of file PlanarTraction.hpp.

◆ operator/() [2/2]

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

◆ operator/=()

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

◆ operator=() [1/3]

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

Copy assignment operator. Assigns this planar force vector by copying another one.

◆ operator=() [2/3]

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

Copy assignment operator. Assigns this planar force vector by copying another one.

Definition at line 99 of file PlanarForce.hpp.

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

◆ operator=() [3/3]

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

Move assignment operator. Assigns this planar force vector by moving another one.

◆ PlanarDirection()

template<typename NumericType = double>
PhQ::PlanarDirection<NumericType> PhQ::PlanarForce< NumericType >::PlanarDirection ( ) const
inline

Returns the planar direction of this planar force vector.

Definition at line 156 of file PlanarForce.hpp.

References PhQ::PlanarVector< NumericType >::PlanarDirection(), and PhQ::DimensionalPlanarVector< Unit::Force, double >::value.

◆ Print() [1/2]

std::string PhQ::DimensionalPlanarVector< Unit::Force , 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 91 of file DimensionalPlanarVector.hpp.

◆ Print() [2/2]

std::string PhQ::DimensionalPlanarVector< Unit::Force , double >::Print ( const Unit::Force  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 97 of file DimensionalPlanarVector.hpp.

◆ SetValue()

constexpr void PhQ::DimensionalPlanarVector< Unit::Force , double >::SetValue ( const PhQ::PlanarVector< double > &  value)
inlineconstexprnoexceptinherited

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

Definition at line 85 of file DimensionalPlanarVector.hpp.

◆ StaticValue()

constexpr PhQ::PlanarVector<double > PhQ::DimensionalPlanarVector< Unit::Force , 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 73 of file DimensionalPlanarVector.hpp.

◆ Unit()

static constexpr Unit::Force PhQ::DimensionalPlanarVector< Unit::Force , 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 56 of file DimensionalPlanarVector.hpp.

◆ Value() [1/2]

constexpr const PhQ::PlanarVector<double >& PhQ::DimensionalPlanarVector< Unit::Force , double >::Value ( ) const
inlineconstexprnoexceptinherited

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

Definition at line 61 of file DimensionalPlanarVector.hpp.

◆ Value() [2/2]

PhQ::PlanarVector<double > PhQ::DimensionalPlanarVector< Unit::Force , double >::Value ( const Unit::Force  unit) const
inlineinherited

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

Definition at line 66 of file DimensionalPlanarVector.hpp.

◆ x()

template<typename NumericType = double>
constexpr ScalarForce<NumericType> PhQ::PlanarForce< NumericType >::x ( ) const
inlineconstexprnoexcept

Returns the x Cartesian component of this planar force vector.

Definition at line 141 of file PlanarForce.hpp.

References PhQ::DimensionalPlanarVector< Unit::Force, double >::value, and PhQ::PlanarVector< NumericType >::x().

Referenced by PhQ::PlanarForce< NumericType >::Create(), and PhQ::PlanarForce< NumericType >::PlanarForce().

◆ XML() [1/2]

std::string PhQ::DimensionalPlanarVector< Unit::Force , 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 123 of file DimensionalPlanarVector.hpp.

◆ XML() [2/2]

std::string PhQ::DimensionalPlanarVector< Unit::Force , double >::XML ( const Unit::Force  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 133 of file DimensionalPlanarVector.hpp.

◆ y()

template<typename NumericType = double>
constexpr ScalarForce<NumericType> PhQ::PlanarForce< NumericType >::y ( ) const
inlineconstexprnoexcept

Returns the y Cartesian component of this planar force vector.

Definition at line 146 of file PlanarForce.hpp.

References PhQ::DimensionalPlanarVector< Unit::Force, double >::value, and PhQ::PlanarVector< NumericType >::y().

Referenced by PhQ::PlanarForce< NumericType >::Create(), and PhQ::PlanarForce< NumericType >::PlanarForce().

◆ YAML() [1/2]

std::string PhQ::DimensionalPlanarVector< Unit::Force , 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 143 of file DimensionalPlanarVector.hpp.

◆ YAML() [2/2]

std::string PhQ::DimensionalPlanarVector< Unit::Force , double >::YAML ( const Unit::Force  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 153 of file DimensionalPlanarVector.hpp.

◆ Zero()

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

Statically creates a planar force vector of zero.

Definition at line 109 of file PlanarForce.hpp.

References PhQ::PlanarVector< NumericType >::Zero().

Member Data Documentation

◆ value

PhQ::PlanarVector<double > PhQ::DimensionalPlanarVector< Unit::Force , double >::value
protectedinherited

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

Definition at line 222 of file DimensionalPlanarVector.hpp.


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