Phyth v0.1.0
A dimensional safe C++ header-only mechanics and electromagnetics simulation library.
Loading...
Searching...
No Matches
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
Phyth Namespace Reference

Namespaces

namespace  Config
 
namespace  Consts
 
namespace  Electromagnetics
 
namespace  Mechanics
 
namespace  Utils
 

Classes

class  CombineField
 Combine multiple fields of the same type. More...
 
struct  DegreePerSecondTag
 
struct  DegreeTag
 
struct  DimComponent
 Extract the N-th base exponent from a Dimension. More...
 
struct  DimComponent< N, Dimension< Ratios... > >
 
struct  DimDiv
 Divide one dimension by another: exponent-wise subtraction. More...
 
struct  DimDiv< Dimension< R1... >, Dimension< R2... > >
 
struct  Dimension
 Compile-time physical dimension as 7 SI base exponents. More...
 
struct  DimEqual
 Check if two dimensions are identical (all exponents equal) More...
 
struct  DimEqual< Dimension< R1... >, Dimension< R2... > >
 
struct  DimMul
 Add two dimensions: exponent-wise addition. More...
 
struct  DimMul< Dimension< R1... >, Dimension< R2... > >
 
struct  DimPower
 Extract the numeric value of the N-th exponent from a Dimension. More...
 
struct  DimPower< N, Dimension< Ratios... > >
 
struct  DimPowerHelper
 Raise a Dimension to an integer power. More...
 
struct  DimPowerHelper< 0, D >
 
struct  DimPowerType
 
struct  DimRcp
 Reciprocal of a dimension: negate all exponents. More...
 
struct  DimRcp< Dimension< Ratios... > >
 
struct  DimRoot
 Take the N-th root of a dimension: divide all exponents by N. More...
 
struct  DimRoot< N, Dimension< Ratios... > >
 
struct  DimToString
 Convert a Dimension to a human-readable string. More...
 
struct  DimToString< Dimension< Ratios... > >
 
class  Field
 Base class for physical fields (scalar or vector) More...
 
struct  FoldLeft
 
struct  FoldLeft< F, T >
 
struct  FoldLeft< F, T1, T2, Rest... >
 
struct  Interval
 Closed interval [min, max] of physical quantities. More...
 
struct  is_dim
 Trait: check if a type is a Dimension instantiation. More...
 
struct  is_dim< Dimension< Ratios... > >
 
struct  is_dimensionless
 Trait: check if a quantity's dimension is dimensionless. More...
 
struct  is_field
 Type trait to check if a type is a Field instantiation. More...
 
struct  is_field_impl
 Implementation helper for is_field trait. More...
 
struct  is_field_impl< T, std::void_t< decltype(static_cast< Field< typename T::value_type > * >(std::declval< T * >())) > >
 
struct  is_quantity
 Trait: check if a type is a Quantity instantiation. More...
 
struct  is_quantity< Quantity< UnitT > >
 
struct  is_quaternion
 Trait: check if a type is a Quaternion instantiation. More...
 
struct  is_quaternion< Quaternion< T > >
 
struct  is_unit
 Trait: check if a type is a Unit instantiation. More...
 
struct  is_unit< Unit< DimT, Scale, TagT > >
 
struct  is_vector
 
struct  is_vector< Vector< N, QuantityT > >
 
struct  is_vector_of_n
 
struct  is_vector_of_n< N, Vector< N, T > >
 
class  IsotropicMaterial
 Linear elastic isotropic material model. More...
 
struct  Matrix
 
struct  Matrix< 3, 3, T >
 3x3 matrix with Quantity components More...
 
struct  NewtonMeterTag
 
struct  Quantity
 Physical quantity with a value and a compile-time unit. More...
 
struct  Quaternion
 Quaternion with Quantity components. More...
 
struct  RadianTag
 
class  TimeHistory
 Time-based history with linear interpolation. More...
 
struct  Unit
 Physical unit with dimension and scale factor relative to SI base. More...
 
struct  UnitDivBin
 
struct  UnitInfo
 Display information for a unit type. More...
 
struct  UnitMulBin
 
struct  UnitRec
 
struct  UnitRegistrar
 Static registrar for unit types. More...
 
class  UnitRegistry
 Singleton registry for unit names and symbols. More...
 
struct  Vector
 
struct  Vector< 3, T >
 3D vector with Quantity components More...
 
struct  VoltagePerMeterTag
 

Typedefs

template<int N, typename D >
using DimComponentT = typename DimComponent< N, D >::type
 Convenience alias for DimComponent.
 
template<typename D1 , typename D2 >
using DimMulT = typename DimMul< D1, D2 >::type
 Convenience alias for DimMul.
 
template<typename D1 , typename D2 >
using DimDivT = typename DimDiv< D1, D2 >::type
 Convenience alias for DimDiv.
 
template<int N, typename D >
using DimRootT = typename DimRoot< N, D >::type
 Convenience alias for DimRoot.
 
template<typename D >
using DimRcpT = typename DimRcp< D >::type
 Convenience alias for DimRcp.
 
using Dimensionless = Dimension< std::ratio< 0 >, std::ratio< 0 >, std::ratio< 0 >, std::ratio< 0 >, std::ratio< 0 >, std::ratio< 0 >, std::ratio< 0 > >
 
using Length = Dimension< std::ratio< 1 >, std::ratio< 0 >, std::ratio< 0 >, std::ratio< 0 >, std::ratio< 0 >, std::ratio< 0 >, std::ratio< 0 > >
 
using Mass = Dimension< std::ratio< 0 >, std::ratio< 1 >, std::ratio< 0 >, std::ratio< 0 >, std::ratio< 0 >, std::ratio< 0 >, std::ratio< 0 > >
 
using Time = Dimension< std::ratio< 0 >, std::ratio< 0 >, std::ratio< 1 >, std::ratio< 0 >, std::ratio< 0 >, std::ratio< 0 >, std::ratio< 0 > >
 
using ElectricCurrent = Dimension< std::ratio< 0 >, std::ratio< 0 >, std::ratio< 0 >, std::ratio< 1 >, std::ratio< 0 >, std::ratio< 0 >, std::ratio< 0 > >
 
using ThermodynamicTemperature = Dimension< std::ratio< 0 >, std::ratio< 0 >, std::ratio< 0 >, std::ratio< 0 >, std::ratio< 1 >, std::ratio< 0 >, std::ratio< 0 > >
 
using AmountOfSubstance = Dimension< std::ratio< 0 >, std::ratio< 0 >, std::ratio< 0 >, std::ratio< 0 >, std::ratio< 0 >, std::ratio< 1 >, std::ratio< 0 > >
 
using LuminousIntensity = Dimension< std::ratio< 0 >, std::ratio< 0 >, std::ratio< 0 >, std::ratio< 0 >, std::ratio< 0 >, std::ratio< 0 >, std::ratio< 1 > >
 
using Velocity = DimDivT< Length, Time >
 
using Acceleration = DimDivT< Velocity, Time >
 
using Force = DimMulT< Mass, Acceleration >
 
using Energy = DimMulT< Force, Length >
 
using Power = DimDivT< Energy, Time >
 
using Pressure = DimDivT< Force, DimMulT< Length, Length > >
 
using Frequency = DimDivT< Dimensionless, Time >
 
using Charge = DimMulT< Time, ElectricCurrent >
 
using ElectricFieldIntensity = DimDivT< Force, Charge >
 
using Voltage = DimDivT< Power, ElectricCurrent >
 
using Resistance = DimDivT< Voltage, ElectricCurrent >
 
using Capacitance = DimDivT< Charge, Voltage >
 
using Inductance = DimDivT< Voltage, DimDivT< ElectricCurrent, Time > >
 
using MagneticFlux = DimMulT< Voltage, Time >
 
using MagneticFluxDensity = DimDivT< MagneticFlux, DimMulT< Length, Length > >
 
using Area = DimMulT< Length, Length >
 
using Volume = DimMulT< Length, Area >
 
using TranslationalStiffness = DimDivT< Force, Length >
 
using DampingCoefficient = DimDivT< Mass, Time >
 
using MassDensity = DimDivT< Mass, Volume >
 
using ElectricPotential = DimDivT< Capacitance, Length >
 
using EnergyDensity = DimDivT< Energy, Volume >
 
using LinearChargeDensity = DimDivT< Charge, Length >
 
using SurfaceChargeDensity = DimDivT< Charge, Area >
 
using BulkChargeDensity = DimDivT< Charge, Volume >
 
using ElectricDipoleMoment = DimMulT< Charge, Length >
 
using MagneticDipoleMoment = DimMulT< ElectricCurrent, Area >
 
using MomentOfInertia = DimMulT< Mass, Area >
 
using AngularVelocity = DimDivT< Dimensionless, Time >
 
using ForceDensity = DimDivT< Force, Volume >
 
template<int Power, typename D >
using DimPowerTypeT = typename DimPowerType< Power, D >::type
 Convenience alias for DimPowerType.
 
using Scalar = Quantity< ScalarUnit >
 
template<template< typename, typename > class F, typename... Ts>
using FoldLeftT = typename FoldLeft< F, Ts... >::type
 
template<typename... Us>
using UnitMulT = FoldLeftT< UnitMulBin, Us... >
 
template<typename... Us>
using UnitDivT = FoldLeftT< UnitDivBin, Us... >
 
template<typename U , typename Ratio = std::ratio<1>>
using UnitRecT = typename UnitRec< U, Ratio >::type
 
template<typename T >
using Matrix3x3 = Matrix< 3, 3, T >
 
template<typename T >
using Vector3 = Vector< 3, T >
 

Enumerations

enum class  OutputMode { Auto , Raw }
 

Functions

std::string formatPower (const double power)
 Format a floating-point exponent for string output.
 
template<typename U1 , typename U2 >
constexpr bool operator== (Quantity< U1 > a, Quantity< U2 > b)
 Equality comparison between two quantities.
 
template<typename U1 , typename U2 >
constexpr bool operator!= (Quantity< U1 > a, Quantity< U2 > b)
 Inequality comparison between two quantities.
 
template<typename U1 , typename U2 >
constexpr bool operator< (Quantity< U1 > a, Quantity< U2 > b)
 Less-than comparison between two quantities.
 
template<typename U1 , typename U2 >
constexpr bool operator> (Quantity< U1 > a, Quantity< U2 > b)
 Greater-than comparison between two quantities.
 
template<typename U1 , typename U2 >
constexpr bool operator<= (Quantity< U1 > a, Quantity< U2 > b)
 Less-than-or-equal comparison between two quantities.
 
template<typename U1 , typename U2 >
constexpr bool operator>= (Quantity< U1 > a, Quantity< U2 > b)
 Greater-than-or-equal comparison between two quantities.
 
template<typename UnitT >
constexpr bool operator== (Quantity< UnitT > a, double scalar)
 Equality comparison: dimensionless quantity == scalar.
 
template<typename UnitT >
constexpr bool operator== (double scalar, Quantity< UnitT > a)
 Equality comparison: scalar == dimensionless quantity.
 
template<typename UnitT >
constexpr bool operator!= (Quantity< UnitT > a, double scalar)
 Inequality comparison: dimensionless quantity != scalar.
 
template<typename UnitT >
constexpr bool operator!= (double scalar, Quantity< UnitT > a)
 Inequality comparison: scalar != dimensionless quantity.
 
template<typename UnitT >
constexpr bool operator< (Quantity< UnitT > a, double scalar)
 Less-than comparison: dimensionless quantity < scalar.
 
template<typename UnitT >
constexpr bool operator< (double scalar, Quantity< UnitT > a)
 Less-than comparison: scalar < dimensionless quantity.
 
template<typename UnitT >
constexpr bool operator> (Quantity< UnitT > a, double scalar)
 Greater-than comparison: dimensionless quantity > scalar.
 
template<typename UnitT >
constexpr bool operator> (double scalar, Quantity< UnitT > a)
 Greater-than comparison: scalar > dimensionless quantity.
 
template<typename UnitT >
constexpr bool operator<= (Quantity< UnitT > a, double scalar)
 Less-than-or-equal comparison: dimensionless quantity <= scalar.
 
template<typename UnitT >
constexpr bool operator<= (double scalar, Quantity< UnitT > a)
 Less-than-or-equal comparison: scalar <= dimensionless quantity.
 
template<typename UnitT >
constexpr bool operator>= (Quantity< UnitT > a, double scalar)
 Greater-than-or-equal comparison: dimensionless quantity >= scalar.
 
template<typename UnitT >
constexpr bool operator>= (double scalar, Quantity< UnitT > a)
 Greater-than-or-equal comparison: scalar >= dimensionless quantity.
 
template<typename U1 , typename U2 >
constexpr auto operator+ (Quantity< U1 > a, Quantity< U2 > b)
 Add two quantities of the same dimension.
 
template<typename U1 , typename U2 >
constexpr auto operator- (Quantity< U1 > a, Quantity< U2 > b)
 Subtract two quantities of the same dimension.
 
template<typename U1 , typename U2 >
constexpr auto operator* (Quantity< U1 > a, Quantity< U2 > b)
 Multiply two quantities.
 
template<typename U1 , typename U2 >
constexpr auto operator/ (Quantity< U1 > a, Quantity< U2 > b)
 Divide one quantity by another.
 
template<typename UnitT >
constexpr auto operator+ (Quantity< UnitT > a, double scalar)
 Add a dimensionless quantity and a scalar.
 
template<typename UnitT >
constexpr auto operator+ (double scalar, Quantity< UnitT > a)
 Add a scalar and a dimensionless quantity (commutative)
 
template<typename UnitT >
constexpr auto operator- (Quantity< UnitT > a, double scalar)
 Subtract a scalar from a dimensionless quantity.
 
template<typename UnitT >
constexpr auto operator- (double scalar, Quantity< UnitT > a)
 Subtract a dimensionless quantity from a scalar.
 
template<typename UnitT >
constexpr auto operator* (Quantity< UnitT > a, double scalar)
 Multiply a quantity by a scalar.
 
template<typename UnitT >
constexpr auto operator* (double scalar, Quantity< UnitT > a)
 Multiply a scalar by a quantity (commutative)
 
template<typename UnitT >
constexpr auto operator/ (Quantity< UnitT > a, double scalar)
 Divide a quantity by a scalar.
 
template<typename UnitT >
constexpr auto operator/ (double scalar, Quantity< UnitT > a)
 Divide a scalar by a quantity, producing an inverse unit.
 
template<typename UnitT >
constexpr auto operator- (Quantity< UnitT > a)
 Unary negation.
 
template<typename UnitT >
constexpr auto operator+ (Quantity< UnitT > a)
 Unary plus.
 
template<typename UnitT >
std::string UnitSymbol ()
 Get the symbol string for a unit type (e.g., "m", "kg", "N")
 
template<typename UnitT >
std::string UnitName ()
 Get the full name string for a unit type (e.g., "meter", "kilogram")
 
std::string FormatValue (const double value)
 Format a raw numeric value for string output.
 
template<typename UnitT >
std::string QuantityToString (const Quantity< UnitT > &q)
 Convert a Quantity to a human-readable string.
 
template<typename UnitT >
std::ostream & operator<< (std::ostream &os, const Quantity< UnitT > &q)
 Stream insertion operator for Quantity.
 
 PHYTH_DEFINE_UNIT_WITH_NAME (AngularVelocity, RadianPerSecond, radps, 1, 1, "rad/s")
 
template<typename T , typename U , std::size_t Row, std::size_t Col>
constexpr auto operator* (T scalar, const Matrix< Row, Col, U > &m)
 
template<typename T , typename U >
constexpr auto operator* (T scalar, const Matrix3x3< U > &m)
 Scalar * Matrix multiplication.
 
template<typename T , typename U >
constexpr auto operator* (const Quantity< T > scalar, const Quaternion< U > &q)
 Scalar * Quaternion multiplication (commutative)
 
template<typename T , std::size_t N, typename U , typename = std::enable_if_t<!is_vector_of_n_v<N, T>>>
constexpr auto operator* (T scalar, const Vector< N, U > &v)
 
template<typename T , typename U , typename = std::enable_if_t<!is_vector3_v<T>>>
constexpr auto operator* (T scalar, const Vector3< U > &v)
 Scalar multiplication (scalar * vector)
 

Variables

template<typename D1 , typename D2 >
constexpr bool dim_equal_v = DimEqual<D1, D2>::value
 Convenience variable template for DimEqual.
 
template<typename T >
constexpr bool is_dim_v = is_dim<T>::value
 Convenience variable template for is_dim.
 
template<typename UnitT >
constexpr bool is_dimensionless_v = is_dimensionless<UnitT>::value
 Convenience variable template for is_dimensionless.
 
template<int N, typename D >
constexpr double dim_power_v = DimPower<N, D>::value
 Convenience variable template for DimPower.
 
template<typename T >
constexpr bool is_quantity_v = is_quantity<T>::value
 Convenience variable template for is_quantity.
 
template<typename T >
constexpr bool is_unit_v = is_unit<T>::value
 
template<typename T >
constexpr bool is_field_v = is_field<T>::value
 Convenience variable template for is_field.
 
template<typename T >
constexpr auto is_quaternion_v = is_quaternion<T>::value
 Convenience variable template for is_quaternion.
 
template<typename VecT >
constexpr auto is_vector_v = is_vector<VecT>::value
 
template<std::size_t N, typename T >
constexpr bool is_vector_of_n_v = is_vector_of_n<N, T>::value
 
template<typename T >
constexpr auto is_vector3_v = is_vector_of_n_v<3, T>
 Convenience variable template for is_vector3.
 

Class Documentation

◆ Phyth::DegreePerSecondTag

struct Phyth::DegreePerSecondTag

Definition at line 203 of file Units.hpp.

◆ Phyth::DegreeTag

struct Phyth::DegreeTag

Definition at line 108 of file Units.hpp.

◆ Phyth::DimComponent

struct Phyth::DimComponent
template<int N, typename D>
struct Phyth::DimComponent< N, D >

Extract the N-th base exponent from a Dimension.

Template Parameters
NIndex (0-based), must be in [0, 6]
DThe Dimension type to query

Definition at line 39 of file Dimension.hpp.

◆ Phyth::DimComponent< N, Dimension< Ratios... > >

struct Phyth::DimComponent< N, Dimension< Ratios... > >
template<int N, typename... Ratios>
struct Phyth::DimComponent< N, Dimension< Ratios... > >

Definition at line 42 of file Dimension.hpp.

Class Members
typedef tuple_element_t< N, tuple< Ratios... > > type

◆ Phyth::DimDiv

struct Phyth::DimDiv
template<typename D1, typename D2>
struct Phyth::DimDiv< D1, D2 >

Divide one dimension by another: exponent-wise subtraction.

Example: Length / Time -> [m^1 s^-1] (velocity)

Definition at line 79 of file Dimension.hpp.

◆ Phyth::DimDiv< Dimension< R1... >, Dimension< R2... > >

struct Phyth::DimDiv< Dimension< R1... >, Dimension< R2... > >
template<typename... R1, typename... R2>
struct Phyth::DimDiv< Dimension< R1... >, Dimension< R2... > >

Definition at line 82 of file Dimension.hpp.

Class Members
typedef Dimension< ratio_subtract< R1, R2 >... > type

◆ Phyth::DimEqual

struct Phyth::DimEqual
template<typename D1, typename D2>
struct Phyth::DimEqual< D1, D2 >

Check if two dimensions are identical (all exponents equal)

Definition at line 138 of file Dimension.hpp.

◆ Phyth::DimMul

struct Phyth::DimMul
template<typename D1, typename D2>
struct Phyth::DimMul< D1, D2 >

Add two dimensions: exponent-wise addition.

Example: Length * Time -> [m^1 s^1]

Definition at line 59 of file Dimension.hpp.

◆ Phyth::DimMul< Dimension< R1... >, Dimension< R2... > >

struct Phyth::DimMul< Dimension< R1... >, Dimension< R2... > >
template<typename... R1, typename... R2>
struct Phyth::DimMul< Dimension< R1... >, Dimension< R2... > >

Definition at line 62 of file Dimension.hpp.

Class Members
typedef Dimension< ratio_add< R1, R2 >... > type

◆ Phyth::DimPower

struct Phyth::DimPower
template<int N, typename D>
struct Phyth::DimPower< N, D >

Extract the numeric value of the N-th exponent from a Dimension.

Template Parameters
NIndex (0-based)
DThe Dimension type

Definition at line 350 of file Dimension.hpp.

◆ Phyth::DimPowerHelper

struct Phyth::DimPowerHelper
template<int P, typename D>
struct Phyth::DimPowerHelper< P, D >

Raise a Dimension to an integer power.

Template Parameters
PThe exponent (non-negative integer)
DThe Dimension to raise

Definition at line 376 of file Dimension.hpp.

Class Members
typedef type > type

◆ Phyth::DimPowerHelper< 0, D >

struct Phyth::DimPowerHelper< 0, D >
template<typename D>
struct Phyth::DimPowerHelper< 0, D >

Definition at line 381 of file Dimension.hpp.

Class Members
typedef Dimensionless type

◆ Phyth::DimPowerType

struct Phyth::DimPowerType
template<int Power, typename D>
struct Phyth::DimPowerType< Power, D >

Definition at line 386 of file Dimension.hpp.

Class Members
typedef typename type type

◆ Phyth::DimRcp

struct Phyth::DimRcp
template<typename D>
struct Phyth::DimRcp< D >

Reciprocal of a dimension: negate all exponents.

Example: reciprocal(Time) -> [s^-1] (frequency)

Definition at line 121 of file Dimension.hpp.

◆ Phyth::DimRcp< Dimension< Ratios... > >

struct Phyth::DimRcp< Dimension< Ratios... > >
template<typename... Ratios>
struct Phyth::DimRcp< Dimension< Ratios... > >

Definition at line 124 of file Dimension.hpp.

Class Members
typedef Dimension< ratio_multiply< Ratios, ratio<-1 > >... > type

◆ Phyth::DimRoot

struct Phyth::DimRoot
template<int N, typename D>
struct Phyth::DimRoot< N, D >

Take the N-th root of a dimension: divide all exponents by N.

Example: sqrt(Area) -> Length

Template Parameters
NRoot index (positive integer). Fails if N <= 0.

Definition at line 101 of file Dimension.hpp.

◆ Phyth::DimRoot< N, Dimension< Ratios... > >

struct Phyth::DimRoot< N, Dimension< Ratios... > >
template<int N, typename... Ratios>
struct Phyth::DimRoot< N, Dimension< Ratios... > >

Definition at line 104 of file Dimension.hpp.

Class Members
typedef Dimension< ratio_divide< Ratios, ratio< N > >... > type

◆ Phyth::DimToString

struct Phyth::DimToString
template<typename D>
struct Phyth::DimToString< D >

Convert a Dimension to a human-readable string.

Example: DimToString<Velocity>::value() -> "m*s^-1" DimToString<Dimensionless>::value() -> "" (empty string)

Edge cases:

  • Exponents of 1 are omitted: "m" not "m^1"
  • Exponents of -1 become "/": "m/s" not "m*s^-1"
  • Multiple denominator terms are grouped: "kg/(m*s^2)" for Pressure

Definition at line 194 of file Dimension.hpp.

◆ Phyth::FoldLeft

struct Phyth::FoldLeft
template<template< typename, typename > class F, typename... Ts>
struct Phyth::FoldLeft< F, Ts >

Definition at line 98 of file Unit.hpp.

◆ Phyth::FoldLeft< F, T >

struct Phyth::FoldLeft< F, T >
template<template< typename, typename > class F, typename T>
struct Phyth::FoldLeft< F, T >

Definition at line 101 of file Unit.hpp.

Class Members
typedef T type

◆ Phyth::FoldLeft< F, T1, T2, Rest... >

struct Phyth::FoldLeft< F, T1, T2, Rest... >
template<template< typename, typename > class F, typename T1, typename T2, typename... Rest>
struct Phyth::FoldLeft< F, T1, T2, Rest... >

Definition at line 107 of file Unit.hpp.

Class Members
typedef typename type, Rest... >::type type

◆ Phyth::NewtonMeterTag

struct Phyth::NewtonMeterTag

Definition at line 139 of file Units.hpp.

◆ Phyth::RadianTag

struct Phyth::RadianTag

Definition at line 103 of file Units.hpp.

◆ Phyth::UnitDivBin

struct Phyth::UnitDivBin
template<typename U1, typename U2>
struct Phyth::UnitDivBin< U1, U2 >

Definition at line 90 of file Unit.hpp.

Class Members
typedef Unit< DimDivT< typename DimensionT, typename DimensionT >, typename type > type

◆ Phyth::UnitInfo

struct Phyth::UnitInfo

Display information for a unit type.

Contains human-readable strings used by QuantityToString().

Definition at line 15 of file UnitsRegistry.hpp.

Class Members
string name

Full unit name, e.g., "Meter", "Kilogram"

string symbol

Unit symbol, e.g., "m", "kg", "N"

◆ Phyth::UnitMulBin

struct Phyth::UnitMulBin
template<typename U1, typename U2>
struct Phyth::UnitMulBin< U1, U2 >

Definition at line 82 of file Unit.hpp.

Class Members
typedef Unit< DimMulT< typename DimensionT, typename DimensionT >, typename type > type

◆ Phyth::UnitRec

struct Phyth::UnitRec
template<typename U, typename Ratio>
struct Phyth::UnitRec< U, Ratio >

Definition at line 125 of file Unit.hpp.

Class Members
typedef Unit< DimDivT< Dimensionless, typename DimensionT >, ratio_multiply< typename ScaleT, Ratio > > type

◆ Phyth::VoltagePerMeterTag

struct Phyth::VoltagePerMeterTag

Definition at line 187 of file Units.hpp.

Typedef Documentation

◆ Acceleration

Definition at line 297 of file Dimension.hpp.

◆ AmountOfSubstance

using Phyth::AmountOfSubstance = typedef Dimension< std::ratio<0>, std::ratio<0>, std::ratio<0>, std::ratio<0>, std::ratio<0>, std::ratio<1>, std::ratio<0> >

Definition at line 286 of file Dimension.hpp.

◆ AngularVelocity

Definition at line 324 of file Dimension.hpp.

◆ Area

Definition at line 311 of file Dimension.hpp.

◆ BulkChargeDensity

Definition at line 320 of file Dimension.hpp.

◆ Capacitance

Definition at line 307 of file Dimension.hpp.

◆ Charge

Definition at line 303 of file Dimension.hpp.

◆ DampingCoefficient

Definition at line 314 of file Dimension.hpp.

◆ DimComponentT

Convenience alias for DimComponent.

Definition at line 51 of file Dimension.hpp.

◆ DimDivT

Convenience alias for DimDiv.

Definition at line 91 of file Dimension.hpp.

◆ Dimensionless

using Phyth::Dimensionless = typedef Dimension< std::ratio<0>, std::ratio<0>, std::ratio<0>, std::ratio<0>, std::ratio<0>, std::ratio<0>, std::ratio<0> >

Definition at line 256 of file Dimension.hpp.

◆ DimMulT

Convenience alias for DimMul.

Definition at line 71 of file Dimension.hpp.

◆ DimPowerTypeT

Convenience alias for DimPowerType.

Example: DimPowerTypeT<2, Length> -> Area DimPowerTypeT<3, Length> -> Volume

Definition at line 398 of file Dimension.hpp.

◆ DimRcpT

Convenience alias for DimRcp.

Definition at line 132 of file Dimension.hpp.

◆ DimRootT

Convenience alias for DimRoot.

Definition at line 113 of file Dimension.hpp.

◆ ElectricCurrent

using Phyth::ElectricCurrent = typedef Dimension< std::ratio<0>, std::ratio<0>, std::ratio<0>, std::ratio<1>, std::ratio<0>, std::ratio<0>, std::ratio<0> >

Definition at line 276 of file Dimension.hpp.

◆ ElectricDipoleMoment

Definition at line 321 of file Dimension.hpp.

◆ ElectricFieldIntensity

Definition at line 304 of file Dimension.hpp.

◆ ElectricPotential

Definition at line 316 of file Dimension.hpp.

◆ Energy

Definition at line 299 of file Dimension.hpp.

◆ EnergyDensity

Definition at line 317 of file Dimension.hpp.

◆ FoldLeftT

template<template< typename, typename > class F, typename... Ts>
using Phyth::FoldLeftT = typedef typename FoldLeft<F, Ts...>::type

Definition at line 116 of file Unit.hpp.

◆ Force

Definition at line 298 of file Dimension.hpp.

◆ ForceDensity

Definition at line 325 of file Dimension.hpp.

◆ Frequency

Definition at line 302 of file Dimension.hpp.

◆ Inductance

Definition at line 308 of file Dimension.hpp.

◆ Length

using Phyth::Length = typedef Dimension< std::ratio<1>, std::ratio<0>, std::ratio<0>, std::ratio<0>, std::ratio<0>, std::ratio<0>, std::ratio<0> >

Definition at line 261 of file Dimension.hpp.

◆ LinearChargeDensity

Definition at line 318 of file Dimension.hpp.

◆ LuminousIntensity

using Phyth::LuminousIntensity = typedef Dimension< std::ratio<0>, std::ratio<0>, std::ratio<0>, std::ratio<0>, std::ratio<0>, std::ratio<0>, std::ratio<1> >

Definition at line 291 of file Dimension.hpp.

◆ MagneticDipoleMoment

Definition at line 322 of file Dimension.hpp.

◆ MagneticFlux

Definition at line 309 of file Dimension.hpp.

◆ MagneticFluxDensity

Definition at line 310 of file Dimension.hpp.

◆ Mass

using Phyth::Mass = typedef Dimension< std::ratio<0>, std::ratio<1>, std::ratio<0>, std::ratio<0>, std::ratio<0>, std::ratio<0>, std::ratio<0> >

Definition at line 266 of file Dimension.hpp.

◆ MassDensity

Definition at line 315 of file Dimension.hpp.

◆ Matrix3x3

Definition at line 12 of file Matrix3x3.hpp.

◆ MomentOfInertia

Definition at line 323 of file Dimension.hpp.

◆ Power

Definition at line 300 of file Dimension.hpp.

◆ Pressure

Definition at line 301 of file Dimension.hpp.

◆ Resistance

Definition at line 306 of file Dimension.hpp.

◆ Scalar

Definition at line 9 of file Quantities.hpp.

◆ SurfaceChargeDensity

Definition at line 319 of file Dimension.hpp.

◆ ThermodynamicTemperature

using Phyth::ThermodynamicTemperature = typedef Dimension< std::ratio<0>, std::ratio<0>, std::ratio<0>, std::ratio<0>, std::ratio<1>, std::ratio<0>, std::ratio<0> >

Definition at line 281 of file Dimension.hpp.

◆ Time

using Phyth::Time = typedef Dimension< std::ratio<0>, std::ratio<0>, std::ratio<1>, std::ratio<0>, std::ratio<0>, std::ratio<0>, std::ratio<0> >

Definition at line 271 of file Dimension.hpp.

◆ TranslationalStiffness

Definition at line 313 of file Dimension.hpp.

◆ UnitDivT

template<typename... Us>
using Phyth::UnitDivT = typedef FoldLeftT<UnitDivBin, Us...>

Definition at line 122 of file Unit.hpp.

◆ UnitMulT

template<typename... Us>
using Phyth::UnitMulT = typedef FoldLeftT<UnitMulBin, Us...>

Definition at line 119 of file Unit.hpp.

◆ UnitRecT

template<typename U , typename Ratio = std::ratio<1>>
using Phyth::UnitRecT = typedef typename UnitRec<U, Ratio>::type

Definition at line 133 of file Unit.hpp.

◆ Vector3

Definition at line 12 of file Vector3.hpp.

◆ Velocity

Definition at line 296 of file Dimension.hpp.

◆ Voltage

Definition at line 305 of file Dimension.hpp.

◆ Volume

Definition at line 312 of file Dimension.hpp.

Enumeration Type Documentation

◆ OutputMode

Enumerator
Auto 
Raw 

Definition at line 5 of file Config.hpp.

Function Documentation

◆ formatPower()

std::string Phyth::formatPower ( const double  power)
inline

Format a floating-point exponent for string output.

Converts 1.000000 -> "1", 0.5 -> "0.5", -1.0 -> "-1" Used by DimToString to produce readable dimension strings.

Definition at line 174 of file Dimension.hpp.

◆ FormatValue()

std::string Phyth::FormatValue ( const double  value)
inline

Format a raw numeric value for string output.

Uses std::ostringstream. Override this function for custom formatting.

Parameters
valueThe value to format
Returns
String representation of the value

Definition at line 718 of file Quantity.hpp.

◆ operator!=() [1/3]

template<typename UnitT >
constexpr bool Phyth::operator!= ( double  scalar,
Quantity< UnitT >  a 
)
constexpr

Inequality comparison: scalar != dimensionless quantity.

Template Parameters
UnitTMust be dimensionless
Parameters
scalarThe scalar value
aThe dimensionless quantity
Returns
true if scalar != a.value

Definition at line 344 of file Quantity.hpp.

◆ operator!=() [2/3]

template<typename U1 , typename U2 >
constexpr bool Phyth::operator!= ( Quantity< U1 >  a,
Quantity< U2 >  b 
)
constexpr

Inequality comparison between two quantities.

Template Parameters
U1Unit type of the left operand
U2Unit type of the right operand
Parameters
aLeft quantity
bRight quantity
Returns
true if the quantities represent different physical values

Example: 1.0_km != 1000.0_m // false 1.0_km != 999.0_m // true

Definition at line 202 of file Quantity.hpp.

◆ operator!=() [3/3]

template<typename UnitT >
constexpr bool Phyth::operator!= ( Quantity< UnitT >  a,
double  scalar 
)
constexpr

Inequality comparison: dimensionless quantity != scalar.

Template Parameters
UnitTMust be dimensionless
Parameters
aThe dimensionless quantity
scalarThe scalar value to compare against
Returns
true if a.value != scalar

Definition at line 329 of file Quantity.hpp.

◆ operator*() [1/8]

template<typename T , typename U >
constexpr auto Phyth::operator* ( const Quantity< T >  scalar,
const Quaternion< U > &  q 
)
constexpr

Scalar * Quaternion multiplication (commutative)

Template Parameters
TScalar type (must be a Quantity, typically Scalar)
UQuaternion component type
Parameters
scalarThe scalar multiplier
qThe quaternion
Returns
Quaternion with all components multiplied by scalar

Definition at line 471 of file Quaternion.hpp.

◆ operator*() [2/8]

template<typename UnitT >
constexpr auto Phyth::operator* ( double  scalar,
Quantity< UnitT >  a 
)
constexpr

Multiply a scalar by a quantity (commutative)

Parameters
scalarThe scalar multiplier
aThe quantity
Returns
Quantity<UnitT> with value scalar * a.value

Definition at line 628 of file Quantity.hpp.

◆ operator*() [3/8]

template<typename U1 , typename U2 >
constexpr auto Phyth::operator* ( Quantity< U1 >  a,
Quantity< U2 >  b 
)
constexpr

Multiply two quantities.

The resulting dimension is the product of the two input dimensions. The resulting unit is dimensionless (scale = 1) with the combined dimension.

Template Parameters
U1Unit type of the left operand
U2Unit type of the right operand
Parameters
aLeft quantity
bRight quantity
Returns
Quantity<Unit<DimMulT<Dim1, Dim2>>>

Example: 5.0_m * 3.0_s // Quantity<Unit<DimMulT<Length, Time>>>(15)

Definition at line 524 of file Quantity.hpp.

◆ operator*() [4/8]

template<typename UnitT >
constexpr auto Phyth::operator* ( Quantity< UnitT >  a,
double  scalar 
)
constexpr

Multiply a quantity by a scalar.

Parameters
aThe quantity
scalarThe scalar multiplier
Returns
Quantity<UnitT> with value a.value * scalar

Definition at line 616 of file Quantity.hpp.

◆ operator*() [5/8]

template<typename T , typename U >
constexpr auto Phyth::operator* ( T  scalar,
const Matrix3x3< U > &  m 
)
constexpr

Scalar * Matrix multiplication.

Template Parameters
TScalar type
UQuantity type of the matrix
Parameters
scalarScalar value
mMatrix to multiply
Returns
auto Matrix scaled by scalar

Example: auto scaled = 2.0 * m;

Definition at line 483 of file Matrix3x3.hpp.

◆ operator*() [6/8]

template<typename T , typename U , std::size_t Row, std::size_t Col>
constexpr auto Phyth::operator* ( T  scalar,
const Matrix< Row, Col, U > &  m 
)
constexpr

Definition at line 262 of file Matrix.hpp.

◆ operator*() [7/8]

template<typename T , typename U , typename = std::enable_if_t<!is_vector3_v<T>>>
constexpr auto Phyth::operator* ( T  scalar,
const Vector3< U > &  v 
)
constexpr

Scalar multiplication (scalar * vector)

This is the symmetric counterpart to Vector3::operator*(U scalar).

Template Parameters
TScalar type (must not be a Vector3)
UQuantity type of the vector components
Parameters
scalarThe scalar multiplier
vThe vector
Returns
Vector3 with each component multiplied by scalar

Example: auto v = 2.0 * Vector3<Quantity<Meter>>(1.0_m, 2.0_m, 3.0_m); // v = (2 m, 4 m, 6 m)

Definition at line 460 of file Vector3.hpp.

◆ operator*() [8/8]

template<typename T , std::size_t N, typename U , typename = std::enable_if_t<!is_vector_of_n_v<N, T>>>
constexpr auto Phyth::operator* ( T  scalar,
const Vector< N, U > &  v 
)
constexpr

Definition at line 228 of file Vector.hpp.

◆ operator+() [1/4]

template<typename UnitT >
constexpr auto Phyth::operator+ ( double  scalar,
Quantity< UnitT >  a 
)
constexpr

Add a scalar and a dimensionless quantity (commutative)

Template Parameters
UnitTMust be dimensionless
Parameters
scalarThe scalar value
aThe dimensionless quantity
Returns
Quantity<UnitT> with value scalar + a.value

Definition at line 572 of file Quantity.hpp.

◆ operator+() [2/4]

template<typename U1 , typename U2 >
constexpr auto Phyth::operator+ ( Quantity< U1 >  a,
Quantity< U2 >  b 
)
constexpr

Add two quantities of the same dimension.

Template Parameters
U1Unit type of the left operand (also the result unit)
U2Unit type of the right operand
Parameters
aLeft quantity
bRight quantity
Returns
Quantity<U1> with value a + b converted to U1's scale

Example: 1.0_m + 50.0_cm // Quantity<Meter>(1.5)

Definition at line 483 of file Quantity.hpp.

◆ operator+() [3/4]

template<typename UnitT >
constexpr auto Phyth::operator+ ( Quantity< UnitT >  a)
constexpr

Unary plus.

Parameters
aThe quantity
Returns
Quantity<UnitT> with value +a.value (a copy)

Definition at line 684 of file Quantity.hpp.

◆ operator+() [4/4]

template<typename UnitT >
constexpr auto Phyth::operator+ ( Quantity< UnitT >  a,
double  scalar 
)
constexpr

Add a dimensionless quantity and a scalar.

Template Parameters
UnitTMust be dimensionless
Parameters
aThe dimensionless quantity
scalarThe scalar value to add
Returns
Quantity<UnitT> with value a.value + scalar

Definition at line 557 of file Quantity.hpp.

◆ operator-() [1/4]

template<typename UnitT >
constexpr auto Phyth::operator- ( double  scalar,
Quantity< UnitT >  a 
)
constexpr

Subtract a dimensionless quantity from a scalar.

Template Parameters
UnitTMust be dimensionless
Parameters
scalarThe scalar value
aThe dimensionless quantity to subtract
Returns
Quantity<UnitT> with value scalar - a.value

Definition at line 602 of file Quantity.hpp.

◆ operator-() [2/4]

template<typename U1 , typename U2 >
constexpr auto Phyth::operator- ( Quantity< U1 >  a,
Quantity< U2 >  b 
)
constexpr

Subtract two quantities of the same dimension.

Template Parameters
U1Unit type of the left operand (also the result unit)
U2Unit type of the right operand
Parameters
aLeft quantity
bRight quantity
Returns
Quantity<U1> with value a - b converted to U1's scale

Example: 1.0_m - 50.0_cm // Quantity<Meter>(0.5)

Definition at line 502 of file Quantity.hpp.

◆ operator-() [3/4]

template<typename UnitT >
constexpr auto Phyth::operator- ( Quantity< UnitT >  a)
constexpr

Unary negation.

Parameters
aThe quantity to negate
Returns
Quantity<UnitT> with value -a.value

Definition at line 673 of file Quantity.hpp.

◆ operator-() [4/4]

template<typename UnitT >
constexpr auto Phyth::operator- ( Quantity< UnitT >  a,
double  scalar 
)
constexpr

Subtract a scalar from a dimensionless quantity.

Template Parameters
UnitTMust be dimensionless
Parameters
aThe dimensionless quantity
scalarThe scalar value to subtract
Returns
Quantity<UnitT> with value a.value - scalar

Definition at line 587 of file Quantity.hpp.

◆ operator/() [1/3]

template<typename UnitT >
constexpr auto Phyth::operator/ ( double  scalar,
Quantity< UnitT >  a 
)
constexpr

Divide a scalar by a quantity, producing an inverse unit.

This is the only way to create inverse dimensions from a scalar.

Template Parameters
UnitTThe unit type of the denominator
Parameters
scalarThe scalar numerator
aThe quantity denominator
Returns
Quantity<Unit<DimDivT<Dimensionless, DimT>>>

Example: auto freq = 1.0 / 2.0_s; // Quantity<Unit<DimRcpT<Time>>>(0.5) // The dimension is s^-1, which is frequency.

Definition at line 659 of file Quantity.hpp.

◆ operator/() [2/3]

template<typename U1 , typename U2 >
constexpr auto Phyth::operator/ ( Quantity< U1 >  a,
Quantity< U2 >  b 
)
constexpr

Divide one quantity by another.

The resulting dimension is the quotient of the two input dimensions. The resulting unit is dimensionless (scale = 1) with the combined dimension.

Template Parameters
U1Unit type of the numerator
U2Unit type of the denominator
Parameters
aNumerator quantity
bDenominator quantity
Returns
Quantity<Unit<DimDivT<Dim1, Dim2>>>

Example: 10.0_m / 2.0_s // Quantity<Unit<Velocity>>(5)

Definition at line 544 of file Quantity.hpp.

◆ operator/() [3/3]

template<typename UnitT >
constexpr auto Phyth::operator/ ( Quantity< UnitT >  a,
double  scalar 
)
constexpr

Divide a quantity by a scalar.

Parameters
aThe quantity
scalarThe scalar divisor
Returns
Quantity<UnitT> with value a.value / scalar

Definition at line 640 of file Quantity.hpp.

◆ operator<() [1/3]

template<typename UnitT >
constexpr bool Phyth::operator< ( double  scalar,
Quantity< UnitT >  a 
)
constexpr

Less-than comparison: scalar < dimensionless quantity.

Template Parameters
UnitTMust be dimensionless
Parameters
scalarThe scalar value
aThe dimensionless quantity
Returns
true if scalar < a.value

Definition at line 374 of file Quantity.hpp.

◆ operator<() [2/3]

template<typename U1 , typename U2 >
constexpr bool Phyth::operator< ( Quantity< U1 >  a,
Quantity< U2 >  b 
)
constexpr

Less-than comparison between two quantities.

Template Parameters
U1Unit type of the left operand
U2Unit type of the right operand
Parameters
aLeft quantity
bRight quantity
Returns
true if a is physically smaller than b

Example: 1.0_m < 100.0_cm // false (equal) 1.0_m < 150.0_cm // true (1m < 1.5m)

Definition at line 220 of file Quantity.hpp.

◆ operator<() [3/3]

template<typename UnitT >
constexpr bool Phyth::operator< ( Quantity< UnitT >  a,
double  scalar 
)
constexpr

Less-than comparison: dimensionless quantity < scalar.

Template Parameters
UnitTMust be dimensionless
Parameters
aThe dimensionless quantity
scalarThe scalar value to compare against
Returns
true if a.value < scalar

Definition at line 359 of file Quantity.hpp.

◆ operator<<()

template<typename UnitT >
std::ostream & Phyth::operator<< ( std::ostream &  os,
const Quantity< UnitT > &  q 
)

Stream insertion operator for Quantity.

Template Parameters
UnitTThe unit type of the quantity
Parameters
osThe output stream
qThe quantity to output
Returns
Reference to the output stream

Definition at line 763 of file Quantity.hpp.

◆ operator<=() [1/3]

template<typename UnitT >
constexpr bool Phyth::operator<= ( double  scalar,
Quantity< UnitT >  a 
)
constexpr

Less-than-or-equal comparison: scalar <= dimensionless quantity.

Template Parameters
UnitTMust be dimensionless
Parameters
scalarThe scalar value
aThe dimensionless quantity
Returns
true if scalar <= a.value

Definition at line 434 of file Quantity.hpp.

◆ operator<=() [2/3]

template<typename U1 , typename U2 >
constexpr bool Phyth::operator<= ( Quantity< U1 >  a,
Quantity< U2 >  b 
)
constexpr

Less-than-or-equal comparison between two quantities.

Template Parameters
U1Unit type of the left operand
U2Unit type of the right operand
Parameters
aLeft quantity
bRight quantity
Returns
true if a is physically smaller than or equal to b

Example: 1.0_m <= 100.0_cm // true (equal) 1.0_m <= 150.0_cm // true 1.0_m <= 80.0_cm // false

Definition at line 259 of file Quantity.hpp.

◆ operator<=() [3/3]

template<typename UnitT >
constexpr bool Phyth::operator<= ( Quantity< UnitT >  a,
double  scalar 
)
constexpr

Less-than-or-equal comparison: dimensionless quantity <= scalar.

Template Parameters
UnitTMust be dimensionless
Parameters
aThe dimensionless quantity
scalarThe scalar value to compare against
Returns
true if a.value <= scalar

Definition at line 419 of file Quantity.hpp.

◆ operator==() [1/3]

template<typename UnitT >
constexpr bool Phyth::operator== ( double  scalar,
Quantity< UnitT >  a 
)
constexpr

Equality comparison: scalar == dimensionless quantity.

Template Parameters
UnitTMust be dimensionless
Parameters
scalarThe scalar value
aThe dimensionless quantity
Returns
true if scalar == a.value

Example: auto angle = 1.0_rad; if (1.0 == angle) { ... } // true

Definition at line 314 of file Quantity.hpp.

◆ operator==() [2/3]

template<typename U1 , typename U2 >
constexpr bool Phyth::operator== ( Quantity< U1 >  a,
Quantity< U2 >  b 
)
constexpr

Equality comparison between two quantities.

Template Parameters
U1Unit type of the left operand
U2Unit type of the right operand
Parameters
aLeft quantity
bRight quantity
Returns
true if both quantities represent the same physical value

Example: 1.0_km == 1000.0_m // true 1.0_km == 999.0_m // false

Definition at line 182 of file Quantity.hpp.

◆ operator==() [3/3]

template<typename UnitT >
constexpr bool Phyth::operator== ( Quantity< UnitT >  a,
double  scalar 
)
constexpr

Equality comparison: dimensionless quantity == scalar.

Template Parameters
UnitTMust be dimensionless
Parameters
aThe dimensionless quantity
scalarThe scalar value to compare against
Returns
true if a.value == scalar

Example: auto angle = 1.0_rad; if (angle == 1.0) { ... } // true

Definition at line 295 of file Quantity.hpp.

◆ operator>() [1/3]

template<typename UnitT >
constexpr bool Phyth::operator> ( double  scalar,
Quantity< UnitT >  a 
)
constexpr

Greater-than comparison: scalar > dimensionless quantity.

Template Parameters
UnitTMust be dimensionless
Parameters
scalarThe scalar value
aThe dimensionless quantity
Returns
true if scalar > a.value

Definition at line 404 of file Quantity.hpp.

◆ operator>() [2/3]

template<typename U1 , typename U2 >
constexpr bool Phyth::operator> ( Quantity< U1 >  a,
Quantity< U2 >  b 
)
constexpr

Greater-than comparison between two quantities.

Template Parameters
U1Unit type of the left operand
U2Unit type of the right operand
Parameters
aLeft quantity
bRight quantity
Returns
true if a is physically larger than b

Example: 1.0_m > 100.0_cm // false (equal) 1.0_m > 80.0_cm // true (1m > 0.8m)

Definition at line 240 of file Quantity.hpp.

◆ operator>() [3/3]

template<typename UnitT >
constexpr bool Phyth::operator> ( Quantity< UnitT >  a,
double  scalar 
)
constexpr

Greater-than comparison: dimensionless quantity > scalar.

Template Parameters
UnitTMust be dimensionless
Parameters
aThe dimensionless quantity
scalarThe scalar value to compare against
Returns
true if a.value > scalar

Definition at line 389 of file Quantity.hpp.

◆ operator>=() [1/3]

template<typename UnitT >
constexpr bool Phyth::operator>= ( double  scalar,
Quantity< UnitT >  a 
)
constexpr

Greater-than-or-equal comparison: scalar >= dimensionless quantity.

Template Parameters
UnitTMust be dimensionless
Parameters
scalarThe scalar value
aThe dimensionless quantity
Returns
true if scalar >= a.value

Definition at line 464 of file Quantity.hpp.

◆ operator>=() [2/3]

template<typename U1 , typename U2 >
constexpr bool Phyth::operator>= ( Quantity< U1 >  a,
Quantity< U2 >  b 
)
constexpr

Greater-than-or-equal comparison between two quantities.

Template Parameters
U1Unit type of the left operand
U2Unit type of the right operand
Parameters
aLeft quantity
bRight quantity
Returns
true if a is physically larger than or equal to b

Example: 1.0_m >= 100.0_cm // true (equal) 1.0_m >= 80.0_cm // true 1.0_m >= 150.0_cm // false

Definition at line 278 of file Quantity.hpp.

◆ operator>=() [3/3]

template<typename UnitT >
constexpr bool Phyth::operator>= ( Quantity< UnitT >  a,
double  scalar 
)
constexpr

Greater-than-or-equal comparison: dimensionless quantity >= scalar.

Template Parameters
UnitTMust be dimensionless
Parameters
aThe dimensionless quantity
scalarThe scalar value to compare against
Returns
true if a.value >= scalar

Definition at line 449 of file Quantity.hpp.

◆ PHYTH_DEFINE_UNIT_WITH_NAME()

Phyth::PHYTH_DEFINE_UNIT_WITH_NAME ( AngularVelocity  ,
RadianPerSecond  ,
radps  ,
1  ,
1  ,
"rad/s"   
)

◆ QuantityToString()

template<typename UnitT >
std::string Phyth::QuantityToString ( const Quantity< UnitT > &  q)

Convert a Quantity to a human-readable string.

Output format depends on Config::output_mode:

  • Raw: "<value> <dimension-string>" (e.g., "5 m*s^-1")
  • Auto: "<value> <transformed dimension-string>" (e.g., "7 J")

If the unit has no registered symbol or name, falls back to dimension string.

Template Parameters
UnitTThe unit type of the quantity
Parameters
qThe quantity to convert
Returns
String representation of the quantity

Definition at line 738 of file Quantity.hpp.

◆ UnitName()

template<typename UnitT >
std::string Phyth::UnitName ( )

Get the full name string for a unit type (e.g., "meter", "kilogram")

Template Parameters
UnitTThe unit type to look up
Returns
The unit name, or empty string if not registered

Definition at line 706 of file Quantity.hpp.

◆ UnitSymbol()

template<typename UnitT >
std::string Phyth::UnitSymbol ( )

Get the symbol string for a unit type (e.g., "m", "kg", "N")

Template Parameters
UnitTThe unit type to look up
Returns
The unit symbol, or empty string if not registered

Definition at line 695 of file Quantity.hpp.

Variable Documentation

◆ dim_equal_v

template<typename D1 , typename D2 >
constexpr bool Phyth::dim_equal_v = DimEqual<D1, D2>::value
inlineconstexpr

Convenience variable template for DimEqual.

Definition at line 149 of file Dimension.hpp.

◆ dim_power_v

template<int N, typename D >
constexpr double Phyth::dim_power_v = DimPower<N, D>::value
inlineconstexpr

Convenience variable template for DimPower.

Example: dim_power_v<0, Velocity> -> 1 (m^1) dim_power_v<2, Velocity> -> -1 (s^-1)

Definition at line 367 of file Dimension.hpp.

◆ is_dim_v

template<typename T >
constexpr bool Phyth::is_dim_v = is_dim<T>::value
inlineconstexpr

Convenience variable template for is_dim.

Definition at line 166 of file Dimension.hpp.

◆ is_dimensionless_v

template<typename UnitT >
constexpr bool Phyth::is_dimensionless_v = is_dimensionless<UnitT>::value
inlineconstexpr

Convenience variable template for is_dimensionless.

Definition at line 341 of file Dimension.hpp.

◆ is_field_v

template<typename T >
constexpr bool Phyth::is_field_v = is_field<T>::value
inlineconstexpr

Convenience variable template for is_field.

Definition at line 97 of file Field.hpp.

◆ is_quantity_v

template<typename T >
constexpr bool Phyth::is_quantity_v = is_quantity<T>::value
inlineconstexpr

Convenience variable template for is_quantity.

Definition at line 165 of file Quantity.hpp.

◆ is_quaternion_v

template<typename T >
constexpr auto Phyth::is_quaternion_v = is_quaternion<T>::value
inlineconstexpr

Convenience variable template for is_quaternion.

Definition at line 459 of file Quaternion.hpp.

◆ is_unit_v

template<typename T >
constexpr bool Phyth::is_unit_v = is_unit<T>::value
inlineconstexpr

Definition at line 79 of file Unit.hpp.

◆ is_vector3_v

template<typename T >
constexpr auto Phyth::is_vector3_v = is_vector_of_n_v<3, T>
inlineconstexpr

Convenience variable template for is_vector3.

Definition at line 441 of file Vector3.hpp.

◆ is_vector_of_n_v

template<std::size_t N, typename T >
constexpr bool Phyth::is_vector_of_n_v = is_vector_of_n<N, T>::value
inlineconstexpr

Definition at line 224 of file Vector.hpp.

◆ is_vector_v

template<typename VecT >
constexpr auto Phyth::is_vector_v = is_vector<VecT>::value
inlineconstexpr

Definition at line 213 of file Vector.hpp.