15#include "wuzp/trafo/internal/translate.hpp"
30template <
template <
typename,
int,
int>
typename ValuesT_,
int DimensionV_,
typename ValueT_,
AnyCoordinateSystem FromT_,
34 :
public PassiveTransformation<PassiveTranslation<ValuesT_, DimensionV_, ValueT_, FromT_, ToT_, UnitsT_...>, FromT_, ToT_> {
37 using ValuesT = ValuesT_<ValueT_, DimensionV_, 1>;
43 template <
typename... Args>
53 auto inverse()
const {
return typename internal::WithFrames<PassiveTranslation, ToT_, FromT_>::type{-
getQuantities()}; }
57 template <
template <
typename,
int,
int>
typename ValuesOtherT_,
int DimensionOtherV_,
typename ValueOtherT_,
typename FromOtherT_,
58 typename ToOtherT_,
typename... UnitsOtherT_>
61 static_assert(internal::SameFrames<
PassiveTranslation, std::remove_cvref_t<
decltype(other)>>::value);
62 return tensor_.isApprox(other.
getTensor(), precision);
72template <
template <
typename,
int,
int>
typename ValuesT_,
int DimensionV_,
typename ValueT_,
typename FromT_,
typename ToT_,
73 typename... UnitsT_,
typename NewFromT_,
typename NewToT_>
74struct WithFrames<PassiveTranslation<ValuesT_, DimensionV_, ValueT_, FromT_, ToT_, UnitsT_...>, NewFromT_, NewToT_> {
75 using type = PassiveTranslation<ValuesT_, DimensionV_, ValueT_, NewFromT_, NewToT_, UnitsT_...>;
83template <
template <
typename,
int,
int>
typename ValuesT_,
int DimensionV_,
typename ValueT_,
typename FromT_,
typename ToT_,
84 typename... UnitsT_,
typename IndicesOtherT_,
typename QuantitiesOtherT_,
typename CoordinateSystemOtherT_,
85 typename AbsoluteOtherT_>
87 Tensor<IndicesOtherT_, QuantitiesOtherT_, CoordinateSystemOtherT_, AbsoluteOtherT_>> {
89 template <
typename ObjectT_>
90 requires std::is_same_v<std::remove_cvref_t<ObjectT_>,
ObjectT>
95 return internal::translate<ToT_>(std::forward<ObjectT_>(
object), transformation.
getQuantities());
101template <
template <
typename,
int,
int>
typename ValuesLhsT_,
int DimensionLhsV_,
typename ValueLhsT_,
typename FromLhsT_,
typename ToLhsT_,
102 typename... UnitsLhsT_,
template <
typename,
int,
int>
typename ValuesRhsT_,
int DimensionRhsV_,
typename ValueRhsT_,
103 typename FromRhsT_,
typename ToRhsT_,
typename... UnitsRhsT_>
105 PassiveTranslation<ValuesRhsT_, DimensionRhsV_, ValueRhsT_, FromRhsT_, ToRhsT_, UnitsRhsT_...>> {
113template <
template <
typename,
int,
int>
typename ValuesLhsT_,
int DimensionLhsV_,
typename ValueLhsT_,
typename FromLhsT_,
typename ToLhsT_,
114 typename... UnitsLhsT_,
template <
typename,
int,
int>
typename ValuesRhsT_,
int DimensionRhsV_,
typename ValueRhsT_,
115 typename FromRhsT_,
typename ToRhsT_,
typename... UnitsRhsT_>
118 static_assert(internal::SameFrames<std::remove_cvref_t<
decltype(lhs)>, std::remove_cvref_t<
decltype(rhs)>>::value);
122template <
template <
typename,
int,
int>
typename ValuesLhsT_,
int DimensionLhsV_,
typename ValueLhsT_,
typename FromLhsT_,
typename ToLhsT_,
123 typename... UnitsLhsT_,
template <
typename,
int,
int>
typename ValuesRhsT_,
int DimensionRhsV_,
typename ValueRhsT_,
124 typename FromRhsT_,
typename ToRhsT_,
typename... UnitsRhsT_>
127 return !(lhs == rhs);
130template <
template <
typename,
int,
int>
typename ValuesT_,
int DimensionV_,
typename ValueT_,
typename FromT_,
typename ToT_,
137template <
template <
typename,
int,
int>
typename ValuesT_,
int DimensionV_,
typename ValueT_,
typename FromT_,
typename ToT_>
140template <
template <
typename,
int,
int>
typename ValuesT_,
typename ValueT_,
typename FromT_,
typename ToT_>
142template <
template <
typename,
int,
int>
typename ValuesT_,
typename ValueT_,
typename FromT_,
typename ToT_>
A passive translation from the coordinate system From to the coordinate system To,...
const TensorT & getTensor() const
The vector t from the origin of To to the origin of From, expressed in To.
auto inverse() const
The inverse translation, from To to From, whose vector from the origin of From to the origin of To is...
bool isApprox(const PassiveTranslation< ValuesOtherT_, DimensionOtherV_, ValueOtherT_, FromOtherT_, ToOtherT_, UnitsOtherT_... > &other, const ValueT precision=Precision< ValueT >::value()) const
Whether both translations, which must transform between the same coordinate systems,...
TypeMatrix< DimensionV_, 1, UnitsT_... > UnitsT
ValuesRhsT_< ValueRhsT_, DimensionV_, 1 > ValuesT
Quantities< ValuesT, UnitsT > QuantitiesT
Tensor< Indices< Up >, QuantitiesT, ToT_, Relative > TensorT
PassiveTranslation(Args &&... args)
const QuantitiesT & getQuantities() const
The components of the translation, like getQuantities() of the linear transformations.
Container to store quantities.
A tensor of rank 0, 1 or 2, whose components are quantities, expressed in a coordinate system,...
Any coordinate system: a specialization of CoordinateSystem, including the intermediate ones of trans...
The alias template ValueMatrix<ValueT_, RowsV_, ColsV_> of any value matrix backend,...
Whether constructing a Class from the arguments copies or moves it, i.e. whether they are a single Cl...
PassiveSpatialTranslation< ValuesT_, 2, ValueT_, FromT_, ToT_ > PassiveSpatialTranslation2
PassiveTranslation< ValuesT_, DimensionV_, ValueT_, FromT_, ToT_, typename AccessUnits< AccessImplementation< ValueT_ > >::Length > PassiveSpatialTranslation
bool operator!=(const Quantities< ValuesLhsT_, UnitsLhsT_ > &lhs, const Quantities< ValuesRhsT_, UnitsRhsT_ > &rhs)
std::ostream & operator<<(std::ostream &lhs, const Quantities< ValuesT_, UnitsT_ > &rhs)
PassiveSpatialTranslation< ValuesT_, 3, ValueT_, FromT_, ToT_ > PassiveSpatialTranslation3
internal::AbsoluteImpl< false > Relative
bool operator==(const Quantities< ValuesLhsT_, UnitsLhsT_ > &lhs, const Quantities< ValuesRhsT_, UnitsRhsT_ > &rhs)
typename CreateTypeMatrix< RowsV_, ColsV_, Types... >::type TypeMatrix
A matrix storing types at compile-time.
wuzp::CompositionTraits< PassiveTranslation< ValuesLhsT_, DimensionLhsV_, ValueLhsT_, FromLhsT_, ToLhsT_, UnitsLhsT_... >, PassiveTranslation< ValuesRhsT_, DimensionRhsV_, ValueRhsT_, FromRhsT_, ToRhsT_, UnitsRhsT_... > >::compose static auto compose(const LhsT &lhs, const PassiveTranslation< ValuesRhsT_, DimensionRhsV_, ValueRhsT_, FromRhsT_, ToRhsT_, UnitsRhsT_... > &rhs)
wuzp::CompositionTraits< PassiveTranslation< ValuesLhsT_, DimensionLhsV_, ValueLhsT_, FromLhsT_, ToLhsT_, UnitsLhsT_... >, PassiveTranslation< ValuesRhsT_, DimensionRhsV_, ValueRhsT_, FromRhsT_, ToRhsT_, UnitsRhsT_... > >::LhsT PassiveTranslation< ValuesLhsT_, DimensionLhsV_, ValueLhsT_, FromLhsT_, ToLhsT_, UnitsLhsT_... > LhsT
The composition lhs * rhs of two transformations, which applies rhs first, then lhs: (lhs * rhs)....
static constexpr ValueT_ value()