Physical Quantities  v1.0.0
C++ library of physical quantities, physical models, and units of measure for scientific computing. https://github.com/acodcha/phq
Angle.hpp
Go to the documentation of this file.
1 // Copyright © 2020-2024 Alexandre Coderre-Chabot
2 //
3 // This file is part of Physical Quantities (PhQ), a C++ library of physical quantities, physical
4 // models, and units of measure for scientific computing.
5 //
6 // Physical Quantities is hosted at:
7 // https://github.com/acodcha/phq
8 //
9 // Physical Quantities is licensed under the MIT License:
10 // https://mit-license.org
11 //
12 // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
13 // associated documentation files (the "Software"), to deal in the Software without restriction,
14 // including without limitation the rights to use, copy, modify, merge, publish, distribute,
15 // sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
16 // furnished to do so, subject to the following conditions:
17 // - The above copyright notice and this permission notice shall be included in all copies or
18 // substantial portions of the Software.
19 // - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
20 // BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
22 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM
23 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 
25 #ifndef PHQ_ANGLE_HPP
26 #define PHQ_ANGLE_HPP
27 
28 #include <cmath>
29 #include <cstddef>
30 #include <functional>
31 #include <ostream>
32 
33 #include "DimensionalScalar.hpp"
34 #include "PlanarVector.hpp"
35 #include "Unit/Angle.hpp"
36 #include "Vector.hpp"
37 
38 namespace PhQ {
39 
40 // Forward declaration for class PhQ::Angle.
41 template <typename NumericType>
42 class Acceleration;
43 
44 // Forward declaration for class PhQ::Angle.
45 template <typename NumericType>
46 class AngularSpeed;
47 
48 // Forward declaration for class PhQ::Angle.
49 template <typename NumericType>
50 class Direction;
51 
52 // Forward declaration for class PhQ::Angle.
53 template <typename NumericType>
54 class Displacement;
55 
56 // Forward declaration for class PhQ::Angle.
57 template <typename NumericType>
58 class Time;
59 
60 // Forward declaration for class PhQ::Angle.
61 template <typename NumericType>
62 class Force;
63 
64 // Forward declaration for class PhQ::Angle.
65 template <typename NumericType>
66 class Frequency;
67 
68 // Forward declaration for class PhQ::Angle.
69 template <typename NumericType>
70 class HeatFlux;
71 
72 // Forward declaration for class PhQ::Angle.
73 template <typename NumericType>
74 class PlanarAcceleration;
75 
76 // Forward declaration for class PhQ::Angle.
77 template <typename NumericType>
78 class PlanarDirection;
79 
80 // Forward declaration for class PhQ::Angle.
81 template <typename NumericType>
82 class PlanarDisplacement;
83 
84 // Forward declaration for class PhQ::Angle.
85 template <typename NumericType>
86 class PlanarForce;
87 
88 // Forward declaration for class PhQ::Angle.
89 template <typename NumericType>
90 class PlanarHeatFlux;
91 
92 // Forward declaration for class PhQ::Angle.
93 template <typename NumericType>
94 class PlanarPosition;
95 
96 // Forward declaration for class PhQ::Angle.
97 template <typename NumericType>
98 class PlanarTemperatureGradient;
99 
100 // Forward declaration for class PhQ::Angle.
101 template <typename NumericType>
102 class PlanarTraction;
103 
104 // Forward declaration for class PhQ::Angle.
105 template <typename NumericType>
106 class PlanarVelocity;
107 
108 // Forward declaration for class PhQ::Angle.
109 template <typename NumericType>
110 class Position;
111 
112 // Forward declaration for class PhQ::Angle.
113 template <typename NumericType>
114 class TemperatureGradient;
115 
116 // Forward declaration for class PhQ::Angle.
117 template <typename NumericType>
118 class Traction;
119 
120 // Forward declaration for class PhQ::Angle.
121 template <typename NumericType>
122 class VectorArea;
123 
124 // Forward declaration for class PhQ::Angle.
125 template <typename NumericType>
126 class Velocity;
127 
128 /// \brief Plane angle between two lines or dihedral angle between two planes.
129 template <typename NumericType = double>
130 class Angle : public DimensionalScalar<Unit::Angle, NumericType> {
131 public:
132  /// \brief Default constructor. Constructs an angle with an uninitialized value.
133  Angle() = default;
134 
135  /// \brief Constructor. Constructs an angle with a given value expressed in a given angle unit.
136  Angle(const NumericType value, const Unit::Angle unit)
137  : DimensionalScalar<Unit::Angle, NumericType>(value, unit) {}
138 
139  /// \brief Constructor. Constructs an angle by computing the angle between two given planar
140  /// vectors.
141  Angle(const PlanarVector<NumericType>& planar_vector_1,
142  const PlanarVector<NumericType>& planar_vector_2)
143  : Angle(std::acos(planar_vector_1.Dot(planar_vector_2)
144  / (planar_vector_1.Magnitude() * planar_vector_2.Magnitude()))) {}
145 
146  /// \brief Constructor. Constructs an angle by computing the angle between two given vectors.
147  Angle(const Vector<NumericType>& vector1, const Vector<NumericType>& vector2)
148  : Angle(std::acos(vector1.Dot(vector2) / (vector1.Magnitude() * vector2.Magnitude()))) {}
149 
150  /// \brief Constructor. Constructs an angle by computing the angle between a given planar vector
151  /// and planar direction.
152  Angle(const PlanarVector<NumericType>& planar_vector,
153  const PlanarDirection<NumericType>& planar_direction);
154 
155  /// \brief Constructor. Constructs an angle by computing the angle between a given vector and
156  /// direction.
157  Angle(const Vector<NumericType>& vector, const Direction<NumericType>& direction);
158 
159  /// \brief Constructor. Constructs an angle by computing the angle between a given planar
160  /// direction and planar vector.
161  Angle(const PlanarDirection<NumericType>& planar_direction,
162  const PlanarVector<NumericType>& planar_vector);
163 
164  /// \brief Constructor. Constructs an angle by computing the angle between a given direction and
165  /// vector.
166  Angle(const Direction<NumericType>& direction, const Vector<NumericType>& vector);
167 
168  /// \brief Constructor. Constructs an angle by computing the angle between two given planar
169  /// directions.
170  Angle(const PlanarDirection<NumericType>& planar_direction_1,
171  const PlanarDirection<NumericType>& planar_direction_2);
172 
173  /// \brief Constructor. Constructs an angle by computing the angle between two given directions.
174  Angle(const Direction<NumericType>& direction1, const Direction<NumericType>& direction2);
175 
176  /// \brief Constructor. Constructs an angle from a given angular speed and time using the
177  /// definition of angular speed.
178  constexpr Angle(const AngularSpeed<NumericType>& angular_speed, const Time<NumericType>& time);
179 
180  /// \brief Constructor. Constructs an angle from a given angular speed and frequency using the
181  /// definition of angular speed.
182  constexpr Angle(
183  const AngularSpeed<NumericType>& angular_speed, const Frequency<NumericType>& frequency);
184 
185  /// \brief Constructor. Constructs an angle by computing the angle between two given acceleration
186  /// vectors.
187  Angle(const Acceleration<NumericType>& acceleration1,
188  const Acceleration<NumericType>& acceleration2);
189 
190  /// \brief Constructor. Constructs an angle by computing the angle between two given vector areas.
191  Angle(const VectorArea<NumericType>& vector_area_1, const VectorArea<NumericType>& vector_area_2);
192 
193  /// \brief Constructor. Constructs an angle by computing the angle between two given
194  /// displacements.
195  Angle(const Displacement<NumericType>& displacement1,
196  const Displacement<NumericType>& displacement2);
197 
198  /// \brief Constructor. Constructs an angle by computing the angle between two given forces.
199  Angle(const Force<NumericType>& force1, const Force<NumericType>& force2);
200 
201  /// \brief Constructor. Constructs an angle by computing the angle between two given heat fluxes.
202  Angle(const HeatFlux<NumericType>& heat_flux_1, const HeatFlux<NumericType>& heat_flux_2);
203 
204  /// \brief Constructor. Constructs an angle by computing the angle between two given planar
205  /// acceleration vectors.
206  Angle(const PlanarAcceleration<NumericType>& planar_acceleration_1,
207  const PlanarAcceleration<NumericType>& planar_acceleration_2);
208 
209  /// \brief Constructor. Constructs an angle by computing the angle between two given planar
210  /// displacements.
211  Angle(const PlanarDisplacement<NumericType>& planar_displacement_1,
212  const PlanarDisplacement<NumericType>& planar_displacement_2);
213 
214  /// \brief Constructor. Constructs an angle by computing the angle between two given planar
215  /// forces.
216  Angle(const PlanarForce<NumericType>& planar_force_1,
217  const PlanarForce<NumericType>& planar_force_2);
218 
219  /// \brief Constructor. Constructs an angle by computing the angle between two given planar heat
220  /// fluxes.
221  Angle(const PlanarHeatFlux<NumericType>& planar_heat_flux_1,
222  const PlanarHeatFlux<NumericType>& planar_heat_flux_2);
223 
224  /// \brief Constructor. Constructs an angle by computing the angle between two given planar
225  /// positions.
226  Angle(const PlanarPosition<NumericType>& planar_position_1,
227  const PlanarPosition<NumericType>& planar_position_2);
228 
229  /// \brief Constructor. Constructs an angle by computing the angle between two given planar
230  /// temperature gradients.
231  Angle(const PlanarTemperatureGradient<NumericType>& planar_temperature_gradient_1,
232  const PlanarTemperatureGradient<NumericType>& planar_temperature_gradient_2);
233 
234  /// \brief Constructor. Constructs an angle by computing the angle between two given planar
235  /// tractions.
236  Angle(const PlanarTraction<NumericType>& planar_traction_1,
237  const PlanarTraction<NumericType>& planar_traction_2);
238 
239  /// \brief Constructor. Constructs an angle by computing the angle between two given planar
240  /// velocities.
241  Angle(const PlanarVelocity<NumericType>& planar_velocity_1,
242  const PlanarVelocity<NumericType>& planar_velocity_2);
243 
244  /// \brief Constructor. Constructs an angle by computing the angle between two given positions.
245  Angle(const Position<NumericType>& position1, const Position<NumericType>& position2);
246 
247  /// \brief Constructor. Constructs an angle by computing the angle between two given temperature
248  /// gradients.
249  Angle(const TemperatureGradient<NumericType>& temperature_gradient_1,
250  const TemperatureGradient<NumericType>& temperature_gradient_2);
251 
252  /// \brief Constructor. Constructs an angle by computing the angle between two given tractions.
253  Angle(const Traction<NumericType>& traction1, const Traction<NumericType>& traction2);
254 
255  /// \brief Constructor. Constructs an angle by computing the angle between two given velocities.
256  Angle(const Velocity<NumericType>& velocity1, const Velocity<NumericType>& velocity2);
257 
258  /// \brief Destructor. Destroys this angle.
259  ~Angle() noexcept = default;
260 
261  /// \brief Copy constructor. Constructs an angle by copying another one.
262  constexpr Angle(const Angle<NumericType>& other) = default;
263 
264  /// \brief Copy constructor. Constructs an angle by copying another one.
265  template <typename OtherNumericType>
266  explicit constexpr Angle(const Angle<OtherNumericType>& other)
267  : Angle(static_cast<NumericType>(other.Value())) {}
268 
269  /// \brief Move constructor. Constructs an angle by moving another one.
270  constexpr Angle(Angle<NumericType>&& other) noexcept = default;
271 
272  /// \brief Copy assignment operator. Assigns this angle by copying another one.
273  constexpr Angle<NumericType>& operator=(const Angle<NumericType>& other) = default;
274 
275  /// \brief Copy assignment operator. Assigns this angle by copying another one.
276  template <typename OtherNumericType>
278  this->value = static_cast<NumericType>(other.Value());
279  return *this;
280  }
281 
282  /// \brief Move assignment operator. Assigns this angle by moving another one.
283  constexpr Angle<NumericType>& operator=(Angle<NumericType>&& other) noexcept = default;
284 
285  /// \brief Statically creates an angle of zero.
286  [[nodiscard]] static constexpr Angle<NumericType> Zero() {
287  return Angle<NumericType>{static_cast<NumericType>(0)};
288  }
289 
290  /// \brief Statically creates an angle with a given value expressed in a given angle unit.
291  template <Unit::Angle Unit>
292  [[nodiscard]] static constexpr Angle<NumericType> Create(const NumericType value) {
293  return Angle<NumericType>{ConvertStatically<Unit::Angle, Unit, Standard<Unit::Angle>>(value)};
294  }
295 
296  constexpr Angle<NumericType> operator+(const Angle<NumericType>& other) const {
297  return Angle<NumericType>{this->value + other.value};
298  }
299 
300  constexpr Angle<NumericType> operator-(const Angle<NumericType>& other) const {
301  return Angle<NumericType>{this->value - other.value};
302  }
303 
304  constexpr Angle<NumericType> operator*(const NumericType number) const {
305  return Angle<NumericType>{this->value * number};
306  }
307 
308  constexpr AngularSpeed<NumericType> operator*(const Frequency<NumericType>& frequency) const;
309 
310  constexpr Angle<NumericType> operator/(const NumericType number) const {
311  return Angle<NumericType>{this->value / number};
312  }
313 
315 
316  constexpr Time<NumericType> operator/(const AngularSpeed<NumericType>& angular_speed) const;
317 
318  constexpr NumericType operator/(const Angle<NumericType>& other) const noexcept {
319  return this->value / other.value;
320  }
321 
322  constexpr void operator+=(const Angle<NumericType>& other) noexcept {
323  this->value += other.value;
324  }
325 
326  constexpr void operator-=(const Angle<NumericType>& other) noexcept {
327  this->value -= other.value;
328  }
329 
330  constexpr void operator*=(const NumericType number) noexcept {
331  this->value *= number;
332  }
333 
334  constexpr void operator/=(const NumericType number) noexcept {
335  this->value /= number;
336  }
337 
338 private:
339  /// \brief Constructor. Constructs an angle with a given value expressed in the standard angle
340  /// unit.
341  explicit constexpr Angle(const NumericType value)
342  : DimensionalScalar<Unit::Angle, NumericType>(value) {}
343 };
344 
345 template <typename NumericType>
346 inline constexpr bool operator==(
347  const Angle<NumericType>& left, const Angle<NumericType>& right) noexcept {
348  return left.Value() == right.Value();
349 }
350 
351 template <typename NumericType>
352 inline constexpr bool operator!=(
353  const Angle<NumericType>& left, const Angle<NumericType>& right) noexcept {
354  return left.Value() != right.Value();
355 }
356 
357 template <typename NumericType>
358 inline constexpr bool operator<(
359  const Angle<NumericType>& left, const Angle<NumericType>& right) noexcept {
360  return left.Value() < right.Value();
361 }
362 
363 template <typename NumericType>
364 inline constexpr bool operator>(
365  const Angle<NumericType>& left, const Angle<NumericType>& right) noexcept {
366  return left.Value() > right.Value();
367 }
368 
369 template <typename NumericType>
370 inline constexpr bool operator<=(
371  const Angle<NumericType>& left, const Angle<NumericType>& right) noexcept {
372  return left.Value() <= right.Value();
373 }
374 
375 template <typename NumericType>
376 inline constexpr bool operator>=(
377  const Angle<NumericType>& left, const Angle<NumericType>& right) noexcept {
378  return left.Value() >= right.Value();
379 }
380 
381 template <typename NumericType>
382 inline std::ostream& operator<<(std::ostream& stream, const Angle<NumericType>& angle) {
383  stream << angle.Print();
384  return stream;
385 }
386 
387 template <typename NumericType>
388 inline constexpr Angle<NumericType> operator*(
389  const NumericType number, const Angle<NumericType>& angle) {
390  return angle * number;
391 }
392 
393 template <typename NumericType>
395  const PlanarVector<NumericType>& other) const {
396  return PhQ::Angle{*this, other};
397 }
398 
399 template <typename NumericType>
401  return PhQ::Angle{*this, other};
402 }
403 
404 } // namespace PhQ
405 
406 namespace std {
407 
408 template <typename NumericType>
409 struct hash<PhQ::Angle<NumericType>> {
410  inline size_t operator()(const PhQ::Angle<NumericType>& angle) const {
411  return hash<NumericType>()(angle.Value());
412  }
413 };
414 
415 } // namespace std
416 
417 #endif // PHQ_ANGLE_HPP
Three-dimensional Euclidean acceleration vector. Contains three components in Cartesian coordinates: ...
Plane angle between two lines or dihedral angle between two planes.
Definition: Angle.hpp:130
Angle(const PlanarPosition< NumericType > &planar_position_1, const PlanarPosition< NumericType > &planar_position_2)
Constructor. Constructs an angle by computing the angle between two given planar positions.
constexpr Angle< NumericType > & operator=(Angle< NumericType > &&other) noexcept=default
Move assignment operator. Assigns this angle by moving another one.
Angle(const Position< NumericType > &position1, const Position< NumericType > &position2)
Constructor. Constructs an angle by computing the angle between two given positions.
Angle(const PlanarTraction< NumericType > &planar_traction_1, const PlanarTraction< NumericType > &planar_traction_2)
Constructor. Constructs an angle by computing the angle between two given planar tractions.
Angle(const PlanarVector< NumericType > &planar_vector_1, const PlanarVector< NumericType > &planar_vector_2)
Constructor. Constructs an angle by computing the angle between two given planar vectors.
Definition: Angle.hpp:141
constexpr Angle< NumericType > operator-(const Angle< NumericType > &other) const
Definition: Angle.hpp:300
static constexpr Angle< NumericType > Create(const NumericType value)
Statically creates an angle with a given value expressed in a given angle unit.
Definition: Angle.hpp:292
constexpr Angle< NumericType > operator+(const Angle< NumericType > &other) const
Definition: Angle.hpp:296
Angle(const PlanarDirection< NumericType > &planar_direction_1, const PlanarDirection< NumericType > &planar_direction_2)
Constructor. Constructs an angle by computing the angle between two given planar directions.
constexpr Angle< NumericType > & operator=(const Angle< OtherNumericType > &other)
Copy assignment operator. Assigns this angle by copying another one.
Definition: Angle.hpp:277
Angle(const Vector< NumericType > &vector1, const Vector< NumericType > &vector2)
Constructor. Constructs an angle by computing the angle between two given vectors.
Definition: Angle.hpp:147
constexpr AngularSpeed< NumericType > operator/(const Time< NumericType > &time) const
constexpr NumericType operator/(const Angle< NumericType > &other) const noexcept
Definition: Angle.hpp:318
constexpr Angle< NumericType > operator*(const NumericType number) const
Definition: Angle.hpp:304
Angle(const HeatFlux< NumericType > &heat_flux_1, const HeatFlux< NumericType > &heat_flux_2)
Constructor. Constructs an angle by computing the angle between two given heat fluxes.
Angle(const Displacement< NumericType > &displacement1, const Displacement< NumericType > &displacement2)
Constructor. Constructs an angle by computing the angle between two given displacements.
constexpr AngularSpeed< NumericType > operator*(const Frequency< NumericType > &frequency) const
constexpr Angle(const NumericType value)
Constructor. Constructs an angle with a given value expressed in the standard angle unit.
Definition: Angle.hpp:341
Angle(const Direction< NumericType > &direction, const Vector< NumericType > &vector)
Constructor. Constructs an angle by computing the angle between a given direction and vector.
constexpr Angle< NumericType > & operator=(const Angle< NumericType > &other)=default
Copy assignment operator. Assigns this angle by copying another one.
Angle(const PlanarDirection< NumericType > &planar_direction, const PlanarVector< NumericType > &planar_vector)
Constructor. Constructs an angle by computing the angle between a given planar direction and planar v...
constexpr void operator-=(const Angle< NumericType > &other) noexcept
Definition: Angle.hpp:326
Angle(const Traction< NumericType > &traction1, const Traction< NumericType > &traction2)
Constructor. Constructs an angle by computing the angle between two given tractions.
constexpr Time< NumericType > operator/(const AngularSpeed< NumericType > &angular_speed) const
Angle(const PlanarHeatFlux< NumericType > &planar_heat_flux_1, const PlanarHeatFlux< NumericType > &planar_heat_flux_2)
Constructor. Constructs an angle by computing the angle between two given planar heat fluxes.
Angle(const PlanarVelocity< NumericType > &planar_velocity_1, const PlanarVelocity< NumericType > &planar_velocity_2)
Constructor. Constructs an angle by computing the angle between two given planar velocities.
Angle(const TemperatureGradient< NumericType > &temperature_gradient_1, const TemperatureGradient< NumericType > &temperature_gradient_2)
Constructor. Constructs an angle by computing the angle between two given temperature gradients.
Angle(const Vector< NumericType > &vector, const Direction< NumericType > &direction)
Constructor. Constructs an angle by computing the angle between a given vector and direction.
constexpr Angle< NumericType > operator/(const NumericType number) const
Definition: Angle.hpp:310
constexpr Angle(const AngularSpeed< NumericType > &angular_speed, const Time< NumericType > &time)
Constructor. Constructs an angle from a given angular speed and time using the definition of angular ...
constexpr void operator+=(const Angle< NumericType > &other) noexcept
Definition: Angle.hpp:322
static constexpr Angle< NumericType > Zero()
Statically creates an angle of zero.
Definition: Angle.hpp:286
Angle(const Force< NumericType > &force1, const Force< NumericType > &force2)
Constructor. Constructs an angle by computing the angle between two given forces.
Angle(const Acceleration< NumericType > &acceleration1, const Acceleration< NumericType > &acceleration2)
Constructor. Constructs an angle by computing the angle between two given acceleration vectors.
constexpr Angle(const AngularSpeed< NumericType > &angular_speed, const Frequency< NumericType > &frequency)
Constructor. Constructs an angle from a given angular speed and frequency using the definition of ang...
Angle(const Velocity< NumericType > &velocity1, const Velocity< NumericType > &velocity2)
Constructor. Constructs an angle by computing the angle between two given velocities.
~Angle() noexcept=default
Destructor. Destroys this angle.
Angle(const PlanarDisplacement< NumericType > &planar_displacement_1, const PlanarDisplacement< NumericType > &planar_displacement_2)
Constructor. Constructs an angle by computing the angle between two given planar displacements.
Angle(const PlanarAcceleration< NumericType > &planar_acceleration_1, const PlanarAcceleration< NumericType > &planar_acceleration_2)
Constructor. Constructs an angle by computing the angle between two given planar acceleration vectors...
Angle(const PlanarTemperatureGradient< NumericType > &planar_temperature_gradient_1, const PlanarTemperatureGradient< NumericType > &planar_temperature_gradient_2)
Constructor. Constructs an angle by computing the angle between two given planar temperature gradient...
Angle(const PlanarForce< NumericType > &planar_force_1, const PlanarForce< NumericType > &planar_force_2)
Constructor. Constructs an angle by computing the angle between two given planar forces.
constexpr void operator/=(const NumericType number) noexcept
Definition: Angle.hpp:334
Angle(const PlanarVector< NumericType > &planar_vector, const PlanarDirection< NumericType > &planar_direction)
Constructor. Constructs an angle by computing the angle between a given planar vector and planar dire...
Angle(const Direction< NumericType > &direction1, const Direction< NumericType > &direction2)
Constructor. Constructs an angle by computing the angle between two given directions.
Angle(const VectorArea< NumericType > &vector_area_1, const VectorArea< NumericType > &vector_area_2)
Constructor. Constructs an angle by computing the angle between two given vector areas.
Angle(const NumericType value, const Unit::Angle unit)
Constructor. Constructs an angle with a given value expressed in a given angle unit.
Definition: Angle.hpp:136
constexpr Angle(Angle< NumericType > &&other) noexcept=default
Move constructor. Constructs an angle by moving another one.
Angle()=default
Default constructor. Constructs an angle with an uninitialized value.
constexpr void operator*=(const NumericType number) noexcept
Definition: Angle.hpp:330
Angular speed, also known as angular rate or angular frequency. Represents the time rate of change of...
Abstract base class that represents any dimensional scalar physical quantity. Such a physical quantit...
double value
Value of this physical quantity expressed in its standard unit of measure.
constexpr double Value() const noexcept
Value of this physical quantity expressed in its standard unit of measure.
static constexpr Unit::Angle Unit()
Standard unit of measure for this physical quantity. This physical quantity's value is stored interna...
std::string Print() const
Prints this physical quantity as a string. This physical quantity's value is expressed in its standar...
Three-dimensional Euclidean direction vector. Contains three components in Cartesian coordinates: x,...
Definition: Direction.hpp:115
Three-dimensional Euclidean displacement vector. Contains three components in Cartesian coordinates: ...
Three-dimensional Euclidean force vector. Contains three components in Cartesian coordinates: x,...
Definition: Force.hpp:52
Frequency. Inverse of a time duration. See also PhQ::Time.
Definition: Frequency.hpp:40
Three-dimensional Euclidean heat flux vector. Contains three components in Cartesian coordinates: x,...
Definition: HeatFlux.hpp:50
Two-dimensional Euclidean acceleration vector in the XY plane. Contains two components in Cartesian c...
two-dimensional Euclidean direction vector in the XY plane. Contains two components in Cartesian coor...
Two-dimensional Euclidean displacement vector in the XY plane. Contains two components in Cartesian c...
Two-dimensional Euclidean force vector in the XY plane. Contains two components in Cartesian coordina...
Definition: PlanarForce.hpp:50
Two-dimensional Euclidean heat flux vector in the XY plane. Contains two components in Cartesian coor...
Two-dimensional Euclidean position vector in the XY plane. Contains two components in Cartesian coord...
Two-dimensional Euclidean temperature gradient vector in the XY plane. Contains two components in Car...
Two-dimensional Euclidean traction vector in the XY plane. Contains two components in Cartesian coord...
Two-dimensional Euclidean vector in the XY plane. Contains two components in Cartesian coordinates: x...
PhQ::Angle< NumericType > Angle(const PlanarVector< NumericType > &other) const
Returns the angle between this two-dimensional planar vector and another one.
Definition: Angle.hpp:394
Two-dimensional Euclidean velocity vector in the XY plane. Contains two components in Cartesian coord...
Three-dimensional Euclidean position vector. Contains three components in Cartesian coordinates: x,...
Definition: Position.hpp:50
Three-dimensional Euclidean temperature gradient vector. Contains three components in Cartesian coord...
Time. Can represent either a point in time, a time duration, or a period. For the inverse of time,...
Definition: Time.hpp:172
Three-dimensional Euclidean traction vector. Contains three components in Cartesian coordinates: x,...
Definition: Traction.hpp:54
Three-dimensional Euclidean vector area. Contains three components in Cartesian coordinates: x,...
Definition: VectorArea.hpp:48
Three-dimensional Euclidean vector. Contains three components in Cartesian coordinates: x,...
Definition: Vector.hpp:60
PhQ::Angle< NumericType > Angle(const Vector< NumericType > &other) const
Returns the angle between this three-dimensional vector and another one.
Definition: Angle.hpp:400
Three-dimensional Euclidean velocity vector. Contains three components in Cartesian coordinates: x,...
Definition: Velocity.hpp:55
Force
Force units.
Definition: Force.hpp:53
TemperatureGradient
Temperature gradient units.
Frequency
Frequency units.
Definition: Frequency.hpp:53
Angle
Angle units.
Definition: Angle.hpp:53
Acceleration
Acceleration units.
Time
Time units.
Definition: Time.hpp:53
AngularSpeed
Angular speed units.
Namespace that encompasses all of the Physical Quantities library's content.
constexpr bool operator<(const Acceleration< NumericType > &left, const Acceleration< NumericType > &right) noexcept
constexpr bool operator<=(const Acceleration< NumericType > &left, const Acceleration< NumericType > &right) noexcept
constexpr Acceleration< NumericType > operator*(const NumericType number, const Acceleration< NumericType > &acceleration)
constexpr bool operator>(const Acceleration< NumericType > &left, const Acceleration< NumericType > &right) noexcept
constexpr bool operator==(const Acceleration< NumericType > &left, const Acceleration< NumericType > &right) noexcept
constexpr bool operator>=(const Acceleration< NumericType > &left, const Acceleration< NumericType > &right) noexcept
constexpr bool operator!=(const Acceleration< NumericType > &left, const Acceleration< NumericType > &right) noexcept
std::ostream & operator<<(std::ostream &stream, const Acceleration< NumericType > &acceleration)