31 #ifndef TOON_INCLUDE_SO2_H
32 #define TOON_INCLUDE_SO2_H
39 template<
typename Precision>
class SO2;
40 template <
typename Precision>
class SE2;
49 template<
typename Precision =
double>
51 friend std::istream&
operator>> <Precision>(std::istream&,
SO2& );
52 friend std::istream&
operator>> <Precision>(std::istream&,
SE2<Precision>& );
65 SO2(
const Precision l) { *
this =
exp(l); }
69 template <
int R,
int C,
typename P,
typename A>
84 inline static SO2 exp(
const Precision & d){
106 template <
typename P>
125 template <
typename PA,
typename PB>
133 template <
typename Precision>
134 inline std::ostream& operator<< (std::ostream& os, const SO2<Precision> & rhs){
135 return os << rhs.get_matrix();
140 template <
typename Precision>
148 template<
int D,
typename P1,
typename PV,
typename Accessor>
155 template<
int D,
typename P1,
typename PV,
typename Accessor>
162 template <
int R,
int C,
typename P1,
typename P2,
typename Accessor>
169 template <
int R,
int C,
typename P1,
typename P2,
typename Accessor>
Precision ln() const
extracts the rotation angle from the SO2
Matrix< R, 2, typename Internal::MultiplyType< P1, P2 >::type > operator*(const Matrix< R, C, P1, Accessor > &lhs, const SO2< P2 > &rhs)
static Operator< Internal::Identity< Internal::One > > Identity
SO2< typename Internal::MultiplyType< Precision, P >::type > operator*(const SO2< P > &rhs) const
Right-multiply by another rotation matrix.
Vector< 2, typename Internal::MultiplyType< P1, PV >::type > operator*(const SO2< P1 > &lhs, const Vector< D, PV, Accessor > &rhs)
Everything lives inside this namespace.
SO2 & operator*=(const SO2< P > &rhs)
Self right-multiply by another rotation matrix.
SO2(const SO2< PA > &a, const SO2< PB > &b)
Matrix< 2, 2, Precision > my_matrix
SO2 & operator=(const Matrix< R, C, P, A > &rhs)
SO2(const Matrix< 2, 2, Precision > &rhs)
Construct from a rotation matrix.
void coerce()
Modifies the matrix to make sure it is a valid rotation matrix.
Vector< 2, typename Internal::MultiplyType< PV, P1 >::type > operator*(const Vector< D, PV, Accessor > &lhs, const SO2< P1 > &rhs)
static Matrix< 2, 2, Precision > generator()
returns generator matrix
std::istream & operator>>(std::istream &is, SO2< Precision > &rhs)
SO2(const Precision l)
Construct from an angle.
Vector< 1 > makeVector(double x1)
SO2()
Default constructor. Initialises the matrix to the identity (no rotation)
Vector< Size, Precision > unit(const Vector< Size, Precision, Base > &v)
std::istream & operator>>(std::istream &is, Vector< Size, Precision, Base > &v)
SO2(const SO2 &so2, const Invert &)
SO2 inverse() const
Returns the inverse of this matrix (=the transpose, so this is a fast operation)
Matrix< 2, C, typename Internal::MultiplyType< P1, P2 >::type > operator*(const SO2< P1 > &lhs, const Matrix< R, C, P2, Accessor > &rhs)
static SO2 exp(const Precision &d)
Exponentiate an angle in the Lie algebra to generate a new SO2.
const Matrix< 2, 2, Precision > & get_matrix() const
Returns the SO2 as a Matrix<2>