10 #ifndef EIGEN_ANGLEAXIS_H 11 #define EIGEN_ANGLEAXIS_H 42 template<
typename _Scalar>
struct traits<AngleAxis<_Scalar> >
44 typedef _Scalar Scalar;
48 template<
typename _Scalar>
49 class AngleAxis :
public RotationBase<AngleAxis<_Scalar>,3>
51 typedef RotationBase<AngleAxis<_Scalar>,3> Base;
55 using Base::operator*;
78 template<
typename Derived>
83 template<
typename Derived>
86 Scalar angle()
const {
return m_angle; }
87 Scalar& angle() {
return m_angle; }
89 const Vector3& axis()
const {
return m_axis; }
90 Vector3& axis() {
return m_axis; }
108 template<
class QuatDerived>
110 template<
typename Derived>
113 template<
typename Derived>
122 template<
typename NewScalarType>
123 inline typename internal::cast_return_type<AngleAxis,AngleAxis<NewScalarType> >::type
cast()
const 124 {
return typename internal::cast_return_type<AngleAxis,AngleAxis<NewScalarType> >::type(*
this); }
127 template<
typename OtherScalarType>
130 m_axis = other.axis().template cast<Scalar>();
131 m_angle =
Scalar(other.angle());
141 {
return m_axis.isApprox(other.m_axis, prec) && internal::isApprox(m_angle,other.m_angle, prec); }
157 template<
typename Scalar>
158 template<
typename QuatDerived>
173 m_axis = q.
vec() / internal::sqrt(n2);
180 template<
typename Scalar>
181 template<
typename Derived>
192 template<
typename Scalar>
193 template<
typename Derived>
201 template<
typename Scalar>
206 Vector3 sin_axis = internal::sin(m_angle) * m_axis;
207 Scalar c = internal::cos(m_angle);
211 tmp = cos1_axis.x() * m_axis.y();
212 res.coeffRef(0,1) = tmp - sin_axis.z();
213 res.coeffRef(1,0) = tmp + sin_axis.z();
215 tmp = cos1_axis.x() * m_axis.z();
216 res.coeffRef(0,2) = tmp + sin_axis.y();
217 res.coeffRef(2,0) = tmp - sin_axis.y();
219 tmp = cos1_axis.y() * m_axis.z();
220 res.coeffRef(1,2) = tmp - sin_axis.x();
221 res.coeffRef(2,1) = tmp + sin_axis.x();
223 res.
diagonal() = (cos1_axis.cwiseProduct(m_axis)).array() + c;
230 #endif // EIGEN_ANGLEAXIS_H AngleAxis()
Definition: AngleAxis.h:72
Scalar w() const
Definition: Quaternion.h:66
AngleAxis(const MatrixBase< Derived > &m)
Definition: AngleAxis.h:84
const VectorBlock< const Coefficients, 3 > vec() const
Definition: Quaternion.h:78
Matrix3 toRotationMatrix(void) const
Definition: AngleAxis.h:203
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
Definition: NumTraits.h:88
AngleAxis inverse() const
Definition: AngleAxis.h:105
AngleAxis< double > AngleAxisd
Definition: AngleAxis.h:149
AngleAxis< float > AngleAxisf
Definition: AngleAxis.h:146
AngleAxis(const QuaternionBase< QuatDerived > &q)
Definition: AngleAxis.h:81
DiagonalReturnType diagonal()
Definition: Diagonal.h:167
bool isApprox(const AngleAxis &other, typename NumTraits< Scalar >::Real prec=NumTraits< Scalar >::dummy_precision()) const
Definition: AngleAxis.h:140
AngleAxis(Scalar angle, const MatrixBase< Derived > &axis)
Definition: AngleAxis.h:79
Base class for quaternion expressions.
Definition: ForwardDeclarations.h:234
internal::cast_return_type< AngleAxis, AngleAxis< NewScalarType > >::type cast() const
Definition: AngleAxis.h:123
QuaternionType operator *(const AngleAxis &other) const
Definition: AngleAxis.h:93
The quaternion class used to represent 3D orientations and rotations.
Definition: ForwardDeclarations.h:261
_Scalar Scalar
Definition: AngleAxis.h:59
The matrix class, also used for vectors and row-vectors.
Definition: Matrix.h:127
AngleAxis(const AngleAxis< OtherScalarType > &other)
Definition: AngleAxis.h:128
Base class for all dense matrices, vectors, and expressions.
Definition: MatrixBase.h:48
Represents a 3D rotation as a rotation angle around an arbitrary 3D axis.
Definition: ForwardDeclarations.h:236