wuzp
Wrong Unit? Zero Points! Compile-time checks for units, coordinate systems and points vs. vectors.
Loading...
Searching...
No Matches
wuzp::PassiveLinearTransformation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_, UnitsT_ > Class Template Reference

A passive linear transformation, i.e. a change of basis, from the coordinate system From to the coordinate system To of the same dimension, like a rotation, whose square matrix A transforms the components v of a vector in From into its components A v in To. More...

#include <wuzp/trafo/PassiveLinearTransformation.hpp>

Inherits wuzp::PassiveTransformation< PassiveLinearTransformation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_, UnitsT_... >, FromT_, ToT_ >.

Public Types

using ValueT = ValueT_
using ValuesT = ValuesT_<ValueT_, DimensionV_, DimensionV_>
using UnitsT = TypeMatrix<DimensionV_, DimensionV_, UnitsT_...>
using QuantitiesT = Quantities<ValuesT, UnitsT>
Public Types inherited from wuzp::PassiveTransformation< PassiveLinearTransformation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_, UnitsT_... >, FromT_, ToT_ >
using From
using To

Public Member Functions

template<typename... Args>
requires (!CopiesOrMoves<PassiveLinearTransformation, Args...>)
 PassiveLinearTransformation (Args &&... args)
const QuantitiesT & getQuantities () const
 The matrix A, which transforms the components v of a vector in From into its components A v in To.
auto inverse () const
 The inverse transformation, from To to From, whose matrix is the matrix inverse A^-1 (see Quantities::inverse()): its units must describe a linear map.
template<template< typename, int, int > typename ValuesOtherT_, typename ValueOtherT_, typename FromOtherT_, typename ToOtherT_, int DimensionOtherV_, typename... UnitsOtherT_>
bool isApprox (const PassiveLinearTransformation< ValuesOtherT_, ValueOtherT_, FromOtherT_, ToOtherT_, DimensionOtherV_, UnitsOtherT_... > &other, const ValueT precision=Precision< ValueT >::value()) const
 Whether both linear transformations, which must transform between the same coordinate systems, are approximately equal: their matrices are compared like the components of tensors (see Tensor::isApprox()).
Public Member Functions inherited from wuzp::PassiveTransformation< PassiveLinearTransformation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_, UnitsT_... >, FromT_, ToT_ >
auto transform (ObjectT_ &&object) const
 The object in To.

Detailed Description

template<template< typename, int, int > typename ValuesT_, typename ValueT_, AnyCoordinateSystem FromT_, AnyCoordinateSystem ToT_, int DimensionV_, typename... UnitsT_>
requires AnyValueMatrix<ValuesT_>
class wuzp::PassiveLinearTransformation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_, UnitsT_ >

A passive linear transformation, i.e. a change of basis, from the coordinate system From to the coordinate system To of the same dimension, like a rotation, whose square matrix A transforms the components v of a vector in From into its components A v in To.

The objects it transforms must be expressed in From. Rotations and Lorentz transformations are passive linear transformations, as classes of their own, which check their validity and invert without a matrix inverse (see PassiveSpatialRotation and LorentzTransformation). A change of basis is the Jacobian of the identity map from From to To, so it composes with Jacobians into Jacobians, by the chain rule. A linear map between coordinate systems of different dimensions is not a change of basis: it is the Jacobian of a change of coordinates, which maps the tangent objects, not the points, and pulls covectors back rather than transforming them with an inverse (see Jacobian). The rows of A are the dual basis covectors of To, and the basis vectors of To are the columns of A^-1, all expressed in From: the dual basis covectors transform like the components, and the basis vectors with the inverse (Carroll, Lecture Notes on General Relativity, https://arxiv.org/abs/gr-qc/9712019, eqs. 1.38 and 1.30). Only if both bases are orthonormal, e.g. for a rotation, whose inverse is its transpose, are the rows of A also the basis vectors of To.

Definition at line 65 of file PassiveLinearTransformation.hpp.

Member Typedef Documentation

◆ QuantitiesT

template<template< typename, int, int > typename ValuesT_, typename ValueT_, AnyCoordinateSystem FromT_, AnyCoordinateSystem ToT_, int DimensionV_, typename... UnitsT_>
using wuzp::PassiveLinearTransformation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_, UnitsT_ >::QuantitiesT = Quantities<ValuesT, UnitsT>

Definition at line 71 of file PassiveLinearTransformation.hpp.

◆ UnitsT

template<template< typename, int, int > typename ValuesT_, typename ValueT_, AnyCoordinateSystem FromT_, AnyCoordinateSystem ToT_, int DimensionV_, typename... UnitsT_>
using wuzp::PassiveLinearTransformation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_, UnitsT_ >::UnitsT = TypeMatrix<DimensionV_, DimensionV_, UnitsT_...>

Definition at line 70 of file PassiveLinearTransformation.hpp.

◆ ValuesT

template<template< typename, int, int > typename ValuesT_, typename ValueT_, AnyCoordinateSystem FromT_, AnyCoordinateSystem ToT_, int DimensionV_, typename... UnitsT_>
using wuzp::PassiveLinearTransformation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_, UnitsT_ >::ValuesT = ValuesT_<ValueT_, DimensionV_, DimensionV_>

Definition at line 69 of file PassiveLinearTransformation.hpp.

◆ ValueT

template<template< typename, int, int > typename ValuesT_, typename ValueT_, AnyCoordinateSystem FromT_, AnyCoordinateSystem ToT_, int DimensionV_, typename... UnitsT_>
using wuzp::PassiveLinearTransformation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_, UnitsT_ >::ValueT = ValueT_

Definition at line 68 of file PassiveLinearTransformation.hpp.

Constructor & Destructor Documentation

◆ PassiveLinearTransformation()

template<template< typename, int, int > typename ValuesT_, typename ValueT_, AnyCoordinateSystem FromT_, AnyCoordinateSystem ToT_, int DimensionV_, typename... UnitsT_>
template<typename... Args>
requires (!CopiesOrMoves<PassiveLinearTransformation, Args...>)
wuzp::PassiveLinearTransformation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_, UnitsT_ >::PassiveLinearTransformation ( Args &&... args)
inlineexplicit

Definition at line 76 of file PassiveLinearTransformation.hpp.

Member Function Documentation

◆ getQuantities()

template<template< typename, int, int > typename ValuesT_, typename ValueT_, AnyCoordinateSystem FromT_, AnyCoordinateSystem ToT_, int DimensionV_, typename... UnitsT_>
const QuantitiesT & wuzp::PassiveLinearTransformation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_, UnitsT_ >::getQuantities ( ) const
inline

The matrix A, which transforms the components v of a vector in From into its components A v in To.

It maps one coordinate system into another, so it is not a tensor in one coordinate system, and there is no getTensor(), unlike for active linear transformations.

Definition at line 81 of file PassiveLinearTransformation.hpp.

◆ inverse()

template<template< typename, int, int > typename ValuesT_, typename ValueT_, AnyCoordinateSystem FromT_, AnyCoordinateSystem ToT_, int DimensionV_, typename... UnitsT_>
auto wuzp::PassiveLinearTransformation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_, UnitsT_ >::inverse ( ) const
inline

The inverse transformation, from To to From, whose matrix is the matrix inverse A^-1 (see Quantities::inverse()): its units must describe a linear map.

This needs a value matrix backend with matrix inverses (InvertibleValueMatrixBackend). The inverses of rotations and Lorentz transformations need no matrix inverse (see PassiveSpatialRotation::inverse() and LorentzTransformation::inverse()).

Definition at line 89 of file PassiveLinearTransformation.hpp.

◆ isApprox()

template<template< typename, int, int > typename ValuesT_, typename ValueT_, AnyCoordinateSystem FromT_, AnyCoordinateSystem ToT_, int DimensionV_, typename... UnitsT_>
template<template< typename, int, int > typename ValuesOtherT_, typename ValueOtherT_, typename FromOtherT_, typename ToOtherT_, int DimensionOtherV_, typename... UnitsOtherT_>
bool wuzp::PassiveLinearTransformation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_, UnitsT_ >::isApprox ( const PassiveLinearTransformation< ValuesOtherT_, ValueOtherT_, FromOtherT_, ToOtherT_, DimensionOtherV_, UnitsOtherT_... > & other,
const ValueT precision = Precision<ValueT>::value() ) const
inline

Whether both linear transformations, which must transform between the same coordinate systems, are approximately equal: their matrices are compared like the components of tensors (see Tensor::isApprox()).

Definition at line 95 of file PassiveLinearTransformation.hpp.


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