A class representing a reference system in a given dimension. More...
#include <ref_system.hpp>
Public Member Functions | |
RefSystem () | |
Constructs a new RefSystem object. | |
RefSystem (const Point< dim > &origin) | |
Constructs a RefSystem object with the specified origin point. | |
RefSystem (const Point< dim > &origin, const Point< dim > &axis) | |
Constructs a reference system with a specified origin. | |
template<int dim_aux = dim> requires (dim_aux == dim && dim == 3) | |
RefSystem (const Point< dim > &origin, const Point< dim > &axis_x, const Point< dim > &axis_y) | |
Constructs a reference system with a specified origin and two axes. | |
const Point< dim > & | get_origin () const |
Gets the origin point of the reference system. | |
const std::array< Point< dim >, dim > & | get_basis () const |
Gets the orthonormal basis of the reference system. | |
bool | is_Cartesian_oriented () const |
Checks if the reference system is Cartesian oriented. | |
Private Member Functions | |
RefSystem (const Point< dim > &origin, const std::array< Point< dim >, dim > &basis) | |
Constructs a reference system with a specified origin and basis. | |
Private Attributes | |
Point< dim > | origin_ |
Origin. | |
std::array< Point< dim >, dim > | basis_ |
Orthonormal basis. | |
A class representing a reference system in a given dimension.
This class provides functionality to create and manage a reference system in a specified dimension. It supports creating Cartesian reference systems centered at the origin with canonical directions, as well as custom reference systems with specified origins and axes.
dim | The dimension of the reference system. |
qugar::impl::RefSystem< dim >::RefSystem | ( | ) |
|
explicit |
Constructs a RefSystem object with the specified origin point.
It creates a reference system with the origin at the given origin
point and the basis with along the Cartesian axes.
origin | The origin point of the reference system. |
qugar::impl::RefSystem< dim >::RefSystem | ( | const Point< dim > & | origin, |
const Point< dim > & | axis ) |
Constructs a reference system with a specified origin.
The given axis
has different meanings depending on the dimension of the reference system. For 1D, the axis is the x-axis; for 2D, the axis is the x-axis; and for 3D, the axis is the z-axis. Thus, in 2D, the y-axis is computed by rotating the given axis
90 degrees. In 3D, given axis
is considered to be the z-axis, then, x- and y-axes are computed to be orthonormal to axis
.
origin | The origin point of the reference system. |
axis | The axis point of the reference system. |
qugar::impl::RefSystem< dim >::RefSystem | ( | const Point< dim > & | origin, |
const Point< dim > & | axis_x, | ||
const Point< dim > & | axis_y ) |
Constructs a reference system with a specified origin and two axes.
This constructor is only available for 3-dimensional reference systems.
The given axis_x
and axis_y
define the xy-plane, but they may not be orthonormal vectors. Thus, the way in which the new system directions are computed is as follows: First, the axis_x
is normalized. Then, the z-axis is computed as the normalized cross-product of the axis_x
and axis_y
. Then, the y-axis is recomputed as the cross-product between normalized vectors along the z- and the x-axes.
dim_aux | Auxiliary template parameter to enforce the dimension check. |
origin | The origin point of the reference system. |
axis_x | The x-axis point of the reference system. |
axis_y | The y-axis point of the reference system. |
|
private |
Constructs a reference system with a specified origin and basis.
This constructor is private and is used internally.
origin | The origin point of the reference system. |
basis | The orthonormal basis of the reference system. |
const std::array< Point< dim >, dim > & qugar::impl::RefSystem< dim >::get_basis | ( | ) | const |
Gets the orthonormal basis of the reference system.
const Point< dim > & qugar::impl::RefSystem< dim >::get_origin | ( | ) | const |
Gets the origin point of the reference system.
|
nodiscard |
Checks if the reference system is Cartesian oriented.
This function determines whether the current reference system is oriented in a Cartesian manner. I.e., if the basis vectors are oriented along the Cartesian directions x, y, z.
|
private |
Orthonormal basis.
|
private |
Origin.