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 253 of file ExtVec.h.

Member Typedef Documentation

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

Definition at line 254 of file ExtVec.h.

Constructor & Destructor Documentation

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

Definition at line 257 of file ExtVec.h.

257  :
258  axis{{(Vec){T(1),0}},
259  {(Vec){0,T(1)}}
260  }{}
Vec2< T > Vec
Definition: ExtVec.h:254
Vec2< T > axis[2]
Definition: ExtVec.h:255
long double T
template<typename T>
constexpr Rot2< T >::Rot2 ( Vec2< T ix,
Vec2< T iy 
)
inline

Definition at line 262 of file ExtVec.h.

262  :
263  axis{ix, iy}{}
Vec2< T > axis[2]
Definition: ExtVec.h:255
template<typename T>
constexpr Rot2< T >::Rot2 ( T  xx,
T  xy,
T  yx,
T  yy 
)
inline

Definition at line 265 of file ExtVec.h.

265  :
266  Rot2( (Vec){xx,xy},
267  (Vec){yx,yy}
268  ){}
Vec2< T > Vec
Definition: ExtVec.h:254
auto xy(V v) -> Vec2< typename std::remove_reference< decltype(v[0])>::type >
Definition: ExtVec.h:67
constexpr Rot2()
Definition: ExtVec.h:257

Member Function Documentation

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

Definition at line 280 of file ExtVec.h.

280  {
281  return transpose().rotateBack(v);
282  }
constexpr Rot2 transpose() const
Definition: ExtVec.h:270
constexpr Vec2< T > rotateBack(Vec2< T > v) const
Definition: ExtVec.h:286
template<typename T>
Rot2 Rot2< T >::rotate ( Rot2< T > const &  r) const
inline

Definition at line 290 of file ExtVec.h.

290  {
291  Rot2 tr = transpose();
292  return Rot2(tr.rotateBack(r.axis[0]),tr.rotateBack(r.axis[1]));
293  }
constexpr Rot2()
Definition: ExtVec.h:257
constexpr Rot2 transpose() const
Definition: ExtVec.h:270
constexpr Vec2< T > rotateBack(Vec2< T > v) const
Definition: ExtVec.h:286
Definition: ExtVec.h:253
template<typename T>
constexpr Vec2<T> Rot2< T >::rotateBack ( Vec2< T v) const
inline

Definition at line 286 of file ExtVec.h.

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

286  {
287  return v[0]*axis[0] + v[1]*axis[1];
288  }
Vec2< T > axis[2]
Definition: ExtVec.h:255
template<typename T>
constexpr Rot2 Rot2< T >::rotateBack ( Rot2< T > const &  r) const
inline

Definition at line 295 of file ExtVec.h.

295  {
296  return Rot2(rotateBack(r.axis[0]),rotateBack(r.axis[1]));
297  }
constexpr Rot2()
Definition: ExtVec.h:257
constexpr Vec2< T > rotateBack(Vec2< T > v) const
Definition: ExtVec.h:286
template<typename T>
constexpr Rot2 Rot2< T >::transpose ( ) const
inline

Definition at line 270 of file ExtVec.h.

270  {
271  return Rot2( axis[0][0], axis[1][0],
272  axis[0][1], axis[1][1]
273  );
274  }
constexpr Rot2()
Definition: ExtVec.h:257
Vec2< T > axis[2]
Definition: ExtVec.h:255
template<typename T>
constexpr Vec2<T> Rot2< T >::x ( ) const
inline
template<typename T>
constexpr Vec2<T> Rot2< T >::y ( ) const
inline

Member Data Documentation

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