CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Public Attributes
Rot2< T > Struct Template Reference

#include <ExtVec.h>

Public Types

typedef Vec2< TVec
 

Public Member Functions

constexpr Rot2 ()
 
constexpr Rot2 (Vec2< T > ix, Vec2< T > iy)
 
constexpr Rot2 (T xx, T xy, T yx, T yy)
 
constexpr Vec2< Trotate (Vec2< T > v) const
 
Rot2 rotate (Rot2 const &r) const
 
constexpr Vec2< TrotateBack (Vec2< T > v) const
 
constexpr Rot2 rotateBack (Rot2 const &r) const
 
constexpr Rot2 transpose () const
 
constexpr Vec2< Tx () const
 
constexpr Vec2< Ty () const
 

Public Attributes

Vec2< Taxis [2]
 

Detailed Description

template<typename T>
struct Rot2< T >

Definition at line 223 of file ExtVec.h.

Member Typedef Documentation

◆ Vec

template<typename T>
typedef Vec2<T> Rot2< T >::Vec

Definition at line 224 of file ExtVec.h.

Constructor & Destructor Documentation

◆ Rot2() [1/3]

template<typename T>
constexpr Rot2< T >::Rot2 ( )
inline

Definition at line 227 of file ExtVec.h.

Referenced by Rot2< Scalar >::rotate(), Rot2< Scalar >::rotateBack(), and Rot2< Scalar >::transpose().

227 : axis{{(Vec){T(1), 0}}, {(Vec){0, T(1)}}} {}
Vec2< T > Vec
Definition: ExtVec.h:224
Vec2< T > axis[2]
Definition: ExtVec.h:225
long double T

◆ Rot2() [2/3]

template<typename T>
constexpr Rot2< T >::Rot2 ( Vec2< T ix,
Vec2< T iy 
)
inline

Definition at line 229 of file ExtVec.h.

229 : axis{ix, iy} {}
Vec2< T > axis[2]
Definition: ExtVec.h:225

◆ Rot2() [3/3]

template<typename T>
constexpr Rot2< T >::Rot2 ( T  xx,
T  xy,
T  yx,
T  yy 
)
inline

Definition at line 231 of file ExtVec.h.

231 : Rot2((Vec){xx, xy}, (Vec){yx, yy}) {}
Vec2< T > Vec
Definition: ExtVec.h:224
auto xy(V v) -> Vec2< typename std::remove_reference< decltype(v[0])>::type >
Definition: ExtVec.h:65
constexpr Rot2()
Definition: ExtVec.h:227

Member Function Documentation

◆ rotate() [1/2]

template<typename T>
constexpr Vec2<T> Rot2< T >::rotate ( Vec2< T v) const
inline

Definition at line 239 of file ExtVec.h.

239 { return transpose().rotateBack(v); }
constexpr Rot2 transpose() const
Definition: ExtVec.h:233
constexpr Vec2< T > rotateBack(Vec2< T > v) const
Definition: ExtVec.h:242

◆ rotate() [2/2]

template<typename T>
Rot2 Rot2< T >::rotate ( Rot2< T > const &  r) const
inline

Definition at line 244 of file ExtVec.h.

244  {
245  Rot2 tr = transpose();
246  return Rot2(tr.rotateBack(r.axis[0]), tr.rotateBack(r.axis[1]));
247  }
constexpr Rot2()
Definition: ExtVec.h:227
constexpr Rot2 transpose() const
Definition: ExtVec.h:233
Definition: ExtVec.h:223
constexpr Vec2< T > rotateBack(Vec2< T > v) const
Definition: ExtVec.h:242

◆ rotateBack() [1/2]

template<typename T>
constexpr Vec2<T> Rot2< T >::rotateBack ( Vec2< T v) const
inline

Definition at line 242 of file ExtVec.h.

Referenced by mathSSE::Rot2< Scalar >::rotate(), Rot2< Scalar >::rotate(), and Rot2< Scalar >::rotateBack().

242 { return v[0] * axis[0] + v[1] * axis[1]; }
Vec2< T > axis[2]
Definition: ExtVec.h:225

◆ rotateBack() [2/2]

template<typename T>
constexpr Rot2 Rot2< T >::rotateBack ( Rot2< T > const &  r) const
inline

Definition at line 249 of file ExtVec.h.

Referenced by Rot2< Scalar >::rotateBack().

249 { return Rot2(rotateBack(r.axis[0]), rotateBack(r.axis[1])); }
constexpr Rot2()
Definition: ExtVec.h:227
constexpr Vec2< T > rotateBack(Vec2< T > v) const
Definition: ExtVec.h:242

◆ transpose()

template<typename T>
constexpr Rot2 Rot2< T >::transpose ( ) const
inline

Definition at line 233 of file ExtVec.h.

Referenced by Rot2< Scalar >::rotate().

233 { return Rot2(axis[0][0], axis[1][0], axis[0][1], axis[1][1]); }
constexpr Rot2()
Definition: ExtVec.h:227
Vec2< T > axis[2]
Definition: ExtVec.h:225

◆ x()

template<typename T>
constexpr Vec2<T> Rot2< T >::x ( ) const
inline

◆ y()

template<typename T>
constexpr Vec2<T> Rot2< T >::y ( ) const
inline

Member Data Documentation

◆ axis

template<typename T>
Vec2<T> Rot2< T >::axis[2]