aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Geometry
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2015-12-03 22:25:26 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2015-12-03 22:25:26 +0100
commit1562e13aba86b7dbb622c40198b487b6d344ee24 (patch)
treeee6535c8a24b3b794d128ad529efec3ff145e887 /Eigen/src/Geometry
parentd2d4c45d55afc7294baa292dd6fc0440dee0a04b (diff)
Add missing Rotation2D::operator=(Matrix2x2)
Diffstat (limited to 'Eigen/src/Geometry')
-rw-r--r--Eigen/src/Geometry/Rotation2D.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/Eigen/src/Geometry/Rotation2D.h b/Eigen/src/Geometry/Rotation2D.h
index 65aa83be5..8b0ddcfb0 100644
--- a/Eigen/src/Geometry/Rotation2D.h
+++ b/Eigen/src/Geometry/Rotation2D.h
@@ -64,6 +64,16 @@ public:
/** Default constructor wihtout initialization. The represented rotation is undefined. */
Rotation2D() {}
+ /** Construct a 2D rotation from a 2x2 rotation matrix \a mat.
+ *
+ * \sa fromRotationMatrix()
+ */
+ template<typename Derived>
+ explicit Rotation2D(const MatrixBase<Derived>& m)
+ {
+ fromRotationMatrix(m.derived());
+ }
+
/** \returns the rotation angle */
inline Scalar angle() const { return m_angle; }
@@ -103,6 +113,17 @@ public:
Rotation2D& fromRotationMatrix(const MatrixBase<Derived>& m);
Matrix2 toRotationMatrix() const;
+ /** Set \c *this from a 2x2 rotation matrix \a mat.
+ * In other words, this function extract the rotation angle from the rotation matrix.
+ *
+ * This method is an alias for fromRotationMatrix()
+ *
+ * \sa fromRotationMatrix()
+ */
+ template<typename Derived>
+ Rotation2D& operator=(const MatrixBase<Derived>& m)
+ { return fromRotationMatrix(m.derived()); }
+
/** \returns the spherical interpolation between \c *this and \a other using
* parameter \a t. It is in fact equivalent to a linear interpolation.
*/