aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Geometry/AngleAxis.h
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2008-08-18 22:17:42 +0000
committerGravatar Gael Guennebaud <g.gael@free.fr>2008-08-18 22:17:42 +0000
commit95dd09bea62010ba3aba36d4833a3cd1594a2372 (patch)
tree40c7e490d0f1cd4b733011d9a4d4fb22fc42decd /Eigen/src/Geometry/AngleAxis.h
parente778ae2559a37b65e9bdd6df687032e33c505cc4 (diff)
* 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
Diffstat (limited to 'Eigen/src/Geometry/AngleAxis.h')
-rw-r--r--Eigen/src/Geometry/AngleAxis.h40
1 files changed, 35 insertions, 5 deletions
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<Matrix3,Matrix3>::Type
operator* (const Matrix3& other) const
{ return toRotationMatrix() * other; }
+ /** Concatenates two rotations */
inline friend typename ProductReturnType<Matrix3,Matrix3>::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<typename Derived>
AngleAxis& operator=(const MatrixBase<Derived>& m);
@@ -179,4 +184,29 @@ AngleAxis<Scalar>::toRotationMatrix(void) const
return res;
}
+/** \geometry_module
+ *
+ * Constructs a 3x3 rotation matrix from the angle-axis \a aa
+ *
+ * \sa Matrix(const Quaternion&)
+ */
+template<typename _Scalar, int _Rows, int _Cols, int _MaxRows, int _MaxCols, unsigned int _Flags>
+Matrix<_Scalar, _Rows, _Cols, _MaxRows, _MaxCols, _Flags>::Matrix(const AngleAxis<Scalar>& 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<typename _Scalar, int _Rows, int _Cols, int _MaxRows, int _MaxCols, unsigned int _Flags>
+Matrix<_Scalar, _Rows, _Cols, _MaxRows, _MaxCols, _Flags>&
+Matrix<_Scalar, _Rows, _Cols, _MaxRows, _MaxCols, _Flags>::operator=(const AngleAxis<Scalar>& aa)
+{
+ EIGEN_STATIC_ASSERT_MATRIX_SPECIFIC_SIZE(Matrix,3,3);
+ return *this = aa.toRotationMatrix();
+}
+
#endif // EIGEN_ANGLEAXIS_H