45 template<
typename _Scalar>
52 using Base::operator*;
72 template<
typename Derived>
75 inline AngleAxis(
const QuaternionType& q) { *
this = q; }
77 template<
typename Derived>
80 Scalar
angle()
const {
return m_angle; }
81 Scalar&
angle() {
return m_angle; }
83 const Vector3&
axis()
const {
return m_axis; }
84 Vector3&
axis() {
return m_axis; }
88 {
return QuaternionType(*
this) * QuaternionType(other); }
91 inline QuaternionType
operator* (
const QuaternionType& other)
const 92 {
return QuaternionType(*
this) * other; }
96 {
return a * QuaternionType(b); }
99 inline Matrix3
operator* (
const Matrix3& other)
const 114 AngleAxis& operator=(
const QuaternionType& q);
115 template<
typename Derived>
118 template<
typename Derived>
127 template<
typename NewScalarType>
132 template<
typename OtherScalarType>
135 m_axis = other.
axis().template cast<Scalar>();
136 m_angle = Scalar(other.
angle());
157 template<
typename Scalar>
160 Scalar n2 = q.
vec().squaredNorm();
161 if (n2 < precision<Scalar>()*precision<Scalar>())
176 template<
typename Scalar>
177 template<
typename Derived>
182 return *
this = QuaternionType(mat);
187 template<
typename Scalar>
192 Vector3 sin_axis =
ei_sin(m_angle) * m_axis;
193 Scalar c =
ei_cos(m_angle);
194 Vector3 cos1_axis = (Scalar(1)-c) * m_axis;
197 tmp = cos1_axis.x() * m_axis.y();
198 res.
coeffRef(0,1) = tmp - sin_axis.z();
199 res.
coeffRef(1,0) = tmp + sin_axis.z();
201 tmp = cos1_axis.x() * m_axis.z();
202 res.
coeffRef(0,2) = tmp + sin_axis.y();
203 res.
coeffRef(2,0) = tmp - sin_axis.y();
205 tmp = cos1_axis.y() * m_axis.z();
206 res.
coeffRef(1,2) = tmp - sin_axis.x();
207 res.
coeffRef(2,1) = tmp + sin_axis.x();
209 res.diagonal() = (cos1_axis.cwise() * m_axis).cwise() + c;
AngleAxis< float > AngleAxisf
static Matrix< Scalar, 2, 2 > toRotationMatrix(const Scalar &s)
AngleAxis & operator=(const QuaternionType &q)
Matrix< Scalar, 3, 3 > Matrix3
iterative scaling algorithm to equilibrate rows and column norms in matrices
Holds information about the various numeric (i.e. scalar) types allowed by Eigen. ...
const internal::permut_matrix_product_retval< PermutationDerived, Derived, OnTheRight > operator*(const MatrixBase< Derived > &matrix, const PermutationBase< PermutationDerived > &permutation)
AngleAxis(const QuaternionType &q)
const Vector3 & axis() const
AngleAxis(Scalar angle, const MatrixBase< Derived > &axis)
AngleAxis< double > AngleAxisd
internal::cast_return_type< AngleAxis, AngleAxis< NewScalarType > >::type cast() const
IntermediateState acos(const Expression &arg)
AngleAxis inverse() const
EIGEN_STRONG_INLINE Scalar & coeffRef(Index rowId, Index colId)
Common base class for compact rotation representations.
Matrix< Scalar, 3, 1 > Vector3
bool ei_isApprox(const Scalar &x, const Scalar &y, typename NumTraits< Scalar >::Real precision=NumTraits< Scalar >::dummy_precision())
Matrix3 toRotationMatrix(void) const
The quaternion class used to represent 3D orientations and rotations.
Quaternion< Scalar > QuaternionType
AngleAxis(const AngleAxis< OtherScalarType > &other)
bool isApprox(const AngleAxis &other, typename NumTraits< Scalar >::Real prec=precision< Scalar >()) const
The matrix class, also used for vectors and row-vectors.
const Block< const Coefficients, 3, 1 > vec() const
AngleAxis(const MatrixBase< Derived > &m)
Base class for all dense matrices, vectors, and expressions.
Represents a 3D rotation as a rotation angle around an arbitrary 3D axis.
RotationBase< AngleAxis< _Scalar >, 3 > Base