mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-12 11:49:02 +08:00
parent
7c41fb66f8
commit
7b2dd988fa
@ -189,6 +189,16 @@ AngleAxis<Scalar>& AngleAxis<Scalar>::operator=(const MatrixBase<Derived>& mat)
|
|||||||
return *this = QuaternionType(mat);
|
return *this = QuaternionType(mat);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Sets \c *this from a 3x3 rotation matrix.
|
||||||
|
**/
|
||||||
|
template<typename Scalar>
|
||||||
|
template<typename Derived>
|
||||||
|
AngleAxis<Scalar>& AngleAxis<Scalar>::fromRotationMatrix(const MatrixBase<Derived>& mat)
|
||||||
|
{
|
||||||
|
return *this = QuaternionType(mat);
|
||||||
|
}
|
||||||
|
|
||||||
/** Constructs and \returns an equivalent 3x3 rotation matrix.
|
/** Constructs and \returns an equivalent 3x3 rotation matrix.
|
||||||
*/
|
*/
|
||||||
template<typename Scalar>
|
template<typename Scalar>
|
||||||
|
@ -85,6 +85,10 @@ template<typename Scalar, int Mode> void transformations(void)
|
|||||||
VERIFY_IS_APPROX(q1 * v1, Quaternionx(aa) * v1);
|
VERIFY_IS_APPROX(q1 * v1, Quaternionx(aa) * v1);
|
||||||
VERIFY_IS_NOT_APPROX(q1 * v1, Quaternionx(AngleAxisx(aa.angle()*2,aa.axis())) * v1);
|
VERIFY_IS_NOT_APPROX(q1 * v1, Quaternionx(AngleAxisx(aa.angle()*2,aa.axis())) * v1);
|
||||||
|
|
||||||
|
aa.fromRotationMatrix(aa.toRotationMatrix());
|
||||||
|
VERIFY_IS_APPROX(q1 * v1, Quaternionx(aa) * v1);
|
||||||
|
VERIFY_IS_NOT_APPROX(q1 * v1, Quaternionx(AngleAxisx(aa.angle()*2,aa.axis())) * v1);
|
||||||
|
|
||||||
// AngleAxis
|
// AngleAxis
|
||||||
VERIFY_IS_APPROX(AngleAxisx(a,v1.normalized()).toRotationMatrix(),
|
VERIFY_IS_APPROX(AngleAxisx(a,v1.normalized()).toRotationMatrix(),
|
||||||
Quaternionx(AngleAxisx(a,v1.normalized())).toRotationMatrix());
|
Quaternionx(AngleAxisx(a,v1.normalized())).toRotationMatrix());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user