Loading [MathJax]/jax/input/TeX/config.js
QUGaR 0.0.7
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Concepts
qugar::impl::RefSystem< dim > Class Template Reference

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.
 

Detailed Description

template<int dim>
class qugar::impl::RefSystem< dim >

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.

Template Parameters
dimThe dimension of the reference system.

Constructor & Destructor Documentation

◆ RefSystem() [1/5]

template<int dim>
qugar::impl::RefSystem< dim >::RefSystem ( )

Constructs a new RefSystem object.

This is the default constructor for the RefSystem class.

It creates a reference system with the origin at the origin point and the basis with along the Cartesian axes.

◆ RefSystem() [2/5]

template<int dim>
qugar::impl::RefSystem< dim >::RefSystem ( const Point< dim > & origin)
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.

Parameters
originThe origin point of the reference system.

◆ RefSystem() [3/5]

template<int dim>
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.

Parameters
originThe origin point of the reference system.
axisThe axis point of the reference system.

◆ RefSystem() [4/5]

template<int dim>
template<int dim_aux = dim>
requires (dim_aux == dim && dim == 3)
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.

Template Parameters
dim_auxAuxiliary template parameter to enforce the dimension check.
Parameters
originThe origin point of the reference system.
axis_xThe x-axis point of the reference system.
axis_yThe y-axis point of the reference system.

◆ RefSystem() [5/5]

template<int dim>
qugar::impl::RefSystem< dim >::RefSystem ( const Point< dim > & origin,
const std::array< Point< dim >, dim > & basis )
private

Constructs a reference system with a specified origin and basis.

This constructor is private and is used internally.

Parameters
originThe origin point of the reference system.
basisThe orthonormal basis of the reference system.

Member Function Documentation

◆ get_basis()

template<int dim>
const std::array< Point< dim >, dim > & qugar::impl::RefSystem< dim >::get_basis ( ) const

Gets the orthonormal basis of the reference system.

Returns
Constant reference to the orthonormal basis of the reference system.

◆ get_origin()

template<int dim>
const Point< dim > & qugar::impl::RefSystem< dim >::get_origin ( ) const

Gets the origin point of the reference system.

Returns
Constant reference to the origin point of the reference system.

◆ is_Cartesian_oriented()

template<int dim>
bool qugar::impl::RefSystem< dim >::is_Cartesian_oriented ( ) const
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.

Returns
true if the reference system is Cartesian oriented, false otherwise.

Member Data Documentation

◆ basis_

template<int dim>
std::array<Point<dim>, dim> qugar::impl::RefSystem< dim >::basis_
private

Orthonormal basis.

◆ origin_

template<int dim>
Point<dim> qugar::impl::RefSystem< dim >::origin_
private

Origin.


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