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

Three-dimensional Euclidean vector area. Contains three components in Cartesian coordinates: x, y, and z. A vector area is an oriented area; it is the three-dimensional Euclidean vector representation of an area. Any closed surface has a vector area: it is the surface integral of its surface normal direction. For the scalar components of a vector area or for the magnitude of a vector area, see PhQ::Area. More...

#include "VectorArea.hpp"

Public Member Functions

 VectorArea ()=default
 Default constructor. Constructs a vector area with an uninitialized value. More...
 
 VectorArea (const Vector< NumericType > &value, const Unit::Area unit)
 Constructor. Constructs a vector area with a given value expressed in a given area unit. More...
 
 VectorArea (const Area< NumericType > &x, const Area< NumericType > &y, const Area< NumericType > &z)
 Constructor. Constructs a vector area from a given set of area components. More...
 
constexpr VectorArea (const Area< NumericType > &area, const Direction< NumericType > &direction)
 Constructor. Constructs a vector area from a given area and direction. More...
 
 ~VectorArea () noexcept=default
 Destructor. Destroys this vector area. More...
 
constexpr VectorArea (const VectorArea< NumericType > &other)=default
 Copy constructor. Constructs a vector area by copying another one. More...
 
template<typename OtherNumericType >
constexpr VectorArea (const VectorArea< OtherNumericType > &other)
 Copy constructor. Constructs a vector area by copying another one. More...
 
constexpr VectorArea (VectorArea< NumericType > &&other) noexcept=default
 Move constructor. Constructs a vector area by moving another one. More...
 
constexpr VectorArea< NumericType > & operator= (const VectorArea< NumericType > &other)=default
 Copy assignment operator. Assigns this vector area by copying another one. More...
 
template<typename OtherNumericType >
constexpr VectorArea< NumericType > & operator= (const VectorArea< OtherNumericType > &other)
 Copy assignment operator. Assigns this vector area by copying another one. More...
 
constexpr VectorArea< NumericType > & operator= (VectorArea< NumericType > &&other) noexcept=default
 Move assignment operator. Assigns this vector area by moving another one. More...
 
constexpr Area< NumericType > x () const noexcept
 Returns the x Cartesian component of this vector area. More...
 
constexpr Area< NumericType > y () const noexcept
 Returns the y Cartesian component of this vector area. More...
 
constexpr Area< NumericType > z () const noexcept
 Returns the z Cartesian component of this vector area. More...
 
Area< NumericType > Magnitude () const
 Returns the magnitude of this vector area. More...
 
PhQ::Direction< NumericType > Direction () const
 Returns the direction of this vector area. More...
 
PhQ::Angle< NumericType > Angle (const VectorArea< NumericType > &vector_area) const
 Returns the angle between this vector area and another one. More...
 
constexpr VectorArea< NumericType > operator+ (const VectorArea< NumericType > &vector_area) const
 
constexpr VectorArea< NumericType > operator- (const VectorArea< NumericType > &vector_area) const
 
constexpr VectorArea< NumericType > operator* (const NumericType number) const
 
constexpr VectorArea< NumericType > operator/ (const NumericType number) const
 
constexpr void operator+= (const VectorArea< NumericType > &vector_area) noexcept
 
constexpr void operator-= (const VectorArea< NumericType > &vector_area) noexcept
 
constexpr void operator*= (const NumericType number) noexcept
 
constexpr void operator/= (const NumericType number) noexcept
 
constexpr const PhQ::Vector< double > & Value () const noexcept
 Value of this physical quantity expressed in its standard unit of measure. More...
 
PhQ::Vector< double > Value (const Unit::Area unit) const
 Value of this physical quantity expressed in a given unit of measure. More...
 
constexpr PhQ::Vector< 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::Vector< 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::Vector< 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::Area 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::Area 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::Area 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::Area 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 VectorArea< NumericType > Zero ()
 Statically creates a vector area of zero. More...
 
template<Unit::Area Unit>
static constexpr VectorArea< NumericType > Create (const NumericType x, const NumericType y, const NumericType z)
 Statically creates a vector area from the given x, y, and z Cartesian components expressed in a given area unit. More...
 
template<Unit::Area Unit>
static constexpr VectorArea< NumericType > Create (const std::array< NumericType, 3 > &x_y_z)
 Statically creates a vector area from the given x, y, and z Cartesian components expressed in a given area unit. More...
 
template<Unit::Area Unit>
static constexpr VectorArea< NumericType > Create (const Vector< NumericType > &value)
 Statically creates a vector area with a given value expressed in a given area unit. More...
 
static constexpr const PhQ::DimensionsDimensions ()
 Physical dimension set of this physical quantity. More...
 
static constexpr Unit::Area 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::Vector< double > value
 Value of this physical quantity expressed in its standard unit of measure. More...
 

Private Member Functions

constexpr VectorArea (const Vector< NumericType > &value)
 Constructor. Constructs a vector area with a given value expressed in the standard area unit. More...
 

Detailed Description

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

Three-dimensional Euclidean vector area. Contains three components in Cartesian coordinates: x, y, and z. A vector area is an oriented area; it is the three-dimensional Euclidean vector representation of an area. Any closed surface has a vector area: it is the surface integral of its surface normal direction. For the scalar components of a vector area or for the magnitude of a vector area, see PhQ::Area.

Definition at line 48 of file VectorArea.hpp.

Constructor & Destructor Documentation

◆ VectorArea() [1/8]

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

Default constructor. Constructs a vector area with an uninitialized value.

◆ VectorArea() [2/8]

template<typename NumericType = double>
PhQ::VectorArea< NumericType >::VectorArea ( const Vector< NumericType > &  value,
const Unit::Area  unit 
)
inline

Constructor. Constructs a vector area with a given value expressed in a given area unit.

Definition at line 55 of file VectorArea.hpp.

◆ VectorArea() [3/8]

template<typename NumericType = double>
PhQ::VectorArea< NumericType >::VectorArea ( const Area< NumericType > &  x,
const Area< NumericType > &  y,
const Area< NumericType > &  z 
)
inline

Constructor. Constructs a vector area from a given set of area components.

Definition at line 59 of file VectorArea.hpp.

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

◆ VectorArea() [4/8]

template<typename NumericType = double>
constexpr PhQ::VectorArea< NumericType >::VectorArea ( const Area< NumericType > &  area,
const Direction< NumericType > &  direction 
)
inlineconstexpr

Constructor. Constructs a vector area from a given area and direction.

Definition at line 63 of file VectorArea.hpp.

◆ ~VectorArea()

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

Destructor. Destroys this vector area.

◆ VectorArea() [5/8]

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

Copy constructor. Constructs a vector area by copying another one.

◆ VectorArea() [6/8]

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

Copy constructor. Constructs a vector area by copying another one.

Definition at line 74 of file VectorArea.hpp.

◆ VectorArea() [7/8]

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

Move constructor. Constructs a vector area by moving another one.

◆ VectorArea() [8/8]

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

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

Definition at line 188 of file VectorArea.hpp.

Member Function Documentation

◆ Angle()

template<typename NumericType = double>
PhQ::Angle<NumericType> PhQ::VectorArea< NumericType >::Angle ( const VectorArea< NumericType > &  vector_area) const
inline

Returns the angle between this vector area and another one.

Definition at line 149 of file VectorArea.hpp.

◆ Create() [1/3]

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

Statically creates a vector area from the given x, y, and z Cartesian components expressed in a given area unit.

Definition at line 101 of file VectorArea.hpp.

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

◆ Create() [2/3]

template<typename NumericType = double>
template<Unit::Area Unit>
static constexpr VectorArea<NumericType> PhQ::VectorArea< NumericType >::Create ( const std::array< NumericType, 3 > &  x_y_z)
inlinestaticconstexpr

Statically creates a vector area from the given x, y, and z Cartesian components expressed in a given area unit.

Definition at line 110 of file VectorArea.hpp.

◆ Create() [3/3]

template<typename NumericType = double>
template<Unit::Area Unit>
static constexpr VectorArea<NumericType> PhQ::VectorArea< NumericType >::Create ( const Vector< NumericType > &  value)
inlinestaticconstexpr

Statically creates a vector area with a given value expressed in a given area unit.

Definition at line 118 of file VectorArea.hpp.

References PhQ::DimensionalVector< Unit::Area, double >::value.

◆ Dimensions()

static constexpr const PhQ::Dimensions& PhQ::DimensionalVector< Unit::Area , double >::Dimensions ( )
inlinestaticconstexprinherited

Physical dimension set of this physical quantity.

Definition at line 50 of file DimensionalVector.hpp.

◆ Direction()

template<typename NumericType = double>
PhQ::Direction<NumericType> PhQ::VectorArea< NumericType >::Direction ( ) const
inline

Returns the direction of this vector area.

Definition at line 144 of file VectorArea.hpp.

References PhQ::Vector< NumericType >::Direction(), and PhQ::DimensionalVector< Unit::Area, double >::value.

◆ JSON() [1/2]

std::string PhQ::DimensionalVector< Unit::Area , 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 DimensionalVector.hpp.

◆ JSON() [2/2]

std::string PhQ::DimensionalVector< Unit::Area , double >::JSON ( const Unit::Area  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 DimensionalVector.hpp.

◆ Magnitude()

template<typename NumericType = double>
Area<NumericType> PhQ::VectorArea< NumericType >::Magnitude ( ) const
inline

Returns the magnitude of this vector area.

Definition at line 139 of file VectorArea.hpp.

References PhQ::Vector< NumericType >::Magnitude(), and PhQ::DimensionalVector< Unit::Area, double >::value.

◆ MutableValue()

constexpr PhQ::Vector<double >& PhQ::DimensionalVector< Unit::Area , 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 DimensionalVector.hpp.

◆ operator*()

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

◆ operator*=()

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

◆ operator+()

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

◆ operator+=()

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

◆ operator-()

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

◆ operator-=()

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

◆ operator/()

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

◆ operator/=()

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

◆ operator=() [1/3]

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

Copy assignment operator. Assigns this vector area by copying another one.

◆ operator=() [2/3]

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

Copy assignment operator. Assigns this vector area by copying another one.

Definition at line 85 of file VectorArea.hpp.

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

◆ operator=() [3/3]

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

Move assignment operator. Assigns this vector area by moving another one.

◆ Print() [1/2]

std::string PhQ::DimensionalVector< Unit::Area , 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 DimensionalVector.hpp.

◆ Print() [2/2]

std::string PhQ::DimensionalVector< Unit::Area , double >::Print ( const Unit::Area  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 DimensionalVector.hpp.

◆ SetValue()

constexpr void PhQ::DimensionalVector< Unit::Area , double >::SetValue ( const PhQ::Vector< 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 DimensionalVector.hpp.

◆ StaticValue()

constexpr PhQ::Vector<double > PhQ::DimensionalVector< Unit::Area , 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 DimensionalVector.hpp.

◆ Unit()

static constexpr Unit::Area PhQ::DimensionalVector< Unit::Area , 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 DimensionalVector.hpp.

◆ Value() [1/2]

constexpr const PhQ::Vector<double >& PhQ::DimensionalVector< Unit::Area , double >::Value ( ) const
inlineconstexprnoexceptinherited

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

Definition at line 61 of file DimensionalVector.hpp.

◆ Value() [2/2]

PhQ::Vector<double > PhQ::DimensionalVector< Unit::Area , double >::Value ( const Unit::Area  unit) const
inlineinherited

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

Definition at line 66 of file DimensionalVector.hpp.

◆ x()

template<typename NumericType = double>
constexpr Area<NumericType> PhQ::VectorArea< NumericType >::x ( ) const
inlineconstexprnoexcept

Returns the x Cartesian component of this vector area.

Definition at line 124 of file VectorArea.hpp.

References PhQ::DimensionalVector< Unit::Area, double >::value, and PhQ::Vector< NumericType >::x().

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

◆ XML() [1/2]

std::string PhQ::DimensionalVector< Unit::Area , 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 DimensionalVector.hpp.

◆ XML() [2/2]

std::string PhQ::DimensionalVector< Unit::Area , double >::XML ( const Unit::Area  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 DimensionalVector.hpp.

◆ y()

template<typename NumericType = double>
constexpr Area<NumericType> PhQ::VectorArea< NumericType >::y ( ) const
inlineconstexprnoexcept

Returns the y Cartesian component of this vector area.

Definition at line 129 of file VectorArea.hpp.

References PhQ::DimensionalVector< Unit::Area, double >::value, and PhQ::Vector< NumericType >::y().

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

◆ YAML() [1/2]

std::string PhQ::DimensionalVector< Unit::Area , 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 DimensionalVector.hpp.

◆ YAML() [2/2]

std::string PhQ::DimensionalVector< Unit::Area , double >::YAML ( const Unit::Area  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 DimensionalVector.hpp.

◆ z()

template<typename NumericType = double>
constexpr Area<NumericType> PhQ::VectorArea< NumericType >::z ( ) const
inlineconstexprnoexcept

Returns the z Cartesian component of this vector area.

Definition at line 134 of file VectorArea.hpp.

References PhQ::DimensionalVector< Unit::Area, double >::value, and PhQ::Vector< NumericType >::z().

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

◆ Zero()

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

Statically creates a vector area of zero.

Definition at line 94 of file VectorArea.hpp.

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

Member Data Documentation

◆ value

PhQ::Vector<double > PhQ::DimensionalVector< Unit::Area , double >::value
protectedinherited

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

Definition at line 217 of file DimensionalVector.hpp.


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