From 95dd09bea62010ba3aba36d4833a3cd1594a2372 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Mon, 18 Aug 2008 22:17:42 +0000 Subject: * revert the previous interface change in solveTriangular (pointer vs reference) * remove the cast operators in the Geometry module: they are replaced by constructors and new operator= in Matrix * extended the operations supported by Rotation2D * rewrite in solveTriangular: - merge the Upper and Lower specializations - big optimization of the path for row-major triangular matrices --- Eigen/src/Geometry/AngleAxis.h | 40 +++++++++++++++++++++++++++++++++++----- 1 file changed, 35 insertions(+), 5 deletions(-) (limited to 'Eigen/src/Geometry/AngleAxis.h') diff --git a/Eigen/src/Geometry/AngleAxis.h b/Eigen/src/Geometry/AngleAxis.h index ba3e9f46e..563735376 100644 --- a/Eigen/src/Geometry/AngleAxis.h +++ b/Eigen/src/Geometry/AngleAxis.h @@ -82,27 +82,32 @@ public: const Vector3& axis() const { return m_axis; } Vector3& axis() { return m_axis; } - /** Automatic conversion to a 3x3 rotation matrix. - * \sa toRotationMatrix() */ - operator Matrix3 () const { return toRotationMatrix(); } - + /** Concatenates two rotations */ inline QuaternionType operator* (const AngleAxis& other) const { return QuaternionType(*this) * QuaternionType(other); } - + + /** Concatenates two rotations */ inline QuaternionType operator* (const QuaternionType& other) const { return QuaternionType(*this) * other; } + /** Concatenates two rotations */ friend inline QuaternionType operator* (const QuaternionType& a, const AngleAxis& b) { return a * QuaternionType(b); } + /** Concatenates two rotations */ inline typename ProductReturnType::Type operator* (const Matrix3& other) const { return toRotationMatrix() * other; } + /** Concatenates two rotations */ inline friend typename ProductReturnType::Type operator* (const Matrix3& a, const AngleAxis& b) { return a * b.toRotationMatrix(); } + /** \Returns the inverse rotation, i.e., an angle-axis with opposite rotation angle */ + AngleAxis inverse() const + { return AngleAxis(-m_angle, m_axis); } + AngleAxis& operator=(const QuaternionType& q); template AngleAxis& operator=(const MatrixBase& m); @@ -179,4 +184,29 @@ AngleAxis::toRotationMatrix(void) const return res; } +/** \geometry_module + * + * Constructs a 3x3 rotation matrix from the angle-axis \a aa + * + * \sa Matrix(const Quaternion&) + */ +template +Matrix<_Scalar, _Rows, _Cols, _MaxRows, _MaxCols, _Flags>::Matrix(const AngleAxis& aa) +{ + EIGEN_STATIC_ASSERT_MATRIX_SPECIFIC_SIZE(Matrix,3,3); + *this = aa.toRotationMatrix(); +} + +/** \geometry_module + * + * Set a 3x3 rotation matrix from the angle-axis \a aa + */ +template +Matrix<_Scalar, _Rows, _Cols, _MaxRows, _MaxCols, _Flags>& +Matrix<_Scalar, _Rows, _Cols, _MaxRows, _MaxCols, _Flags>::operator=(const AngleAxis& aa) +{ + EIGEN_STATIC_ASSERT_MATRIX_SPECIFIC_SIZE(Matrix,3,3); + return *this = aa.toRotationMatrix(); +} + #endif // EIGEN_ANGLEAXIS_H -- cgit v1.2.3