aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Geometry/Rotation2D.h
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2014-10-20 11:04:32 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2014-10-20 11:04:32 +0200
commitb4a9b3f4960657bf2fc156ba5c25a3a32417b861 (patch)
treef3b80669596740c7f3adc3be8b0d133bf4517998 /Eigen/src/Geometry/Rotation2D.h
parentd04f23260def5c61bce01942b4b74eb0c77c54ed (diff)
Add unit tests for Rotation2D's inverse(), operator*, slerp, and fix regression wrt explicit ctor change
Diffstat (limited to 'Eigen/src/Geometry/Rotation2D.h')
-rw-r--r--Eigen/src/Geometry/Rotation2D.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/Eigen/src/Geometry/Rotation2D.h b/Eigen/src/Geometry/Rotation2D.h
index 776c36144..4feb3d4d2 100644
--- a/Eigen/src/Geometry/Rotation2D.h
+++ b/Eigen/src/Geometry/Rotation2D.h
@@ -71,11 +71,11 @@ public:
inline Scalar& angle() { return m_angle; }
/** \returns the inverse rotation */
- inline Rotation2D inverse() const { return -m_angle; }
+ inline Rotation2D inverse() const { return Rotation2D(-m_angle); }
/** Concatenates two rotations */
inline Rotation2D operator*(const Rotation2D& other) const
- { return m_angle + other.m_angle; }
+ { return Rotation2D(m_angle + other.m_angle); }
/** Concatenates two rotations */
inline Rotation2D& operator*=(const Rotation2D& other)
@@ -93,7 +93,7 @@ public:
* parameter \a t. It is in fact equivalent to a linear interpolation.
*/
inline Rotation2D slerp(const Scalar& t, const Rotation2D& other) const
- { return m_angle * (1-t) + other.angle() * t; }
+ { return Rotation2D(m_angle * (1-t) + other.angle() * t); }
/** \returns \c *this with scalar type casted to \a NewScalarType
*