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>
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>
174 m_axis = q.
vec() / sqrt(n2);
181 template<
typename Scalar>
182 template<
typename Derived>
193 template<
typename Scalar>
194 template<
typename Derived>
202 template<
typename Scalar>
209 Vector3 sin_axis = sin(m_angle) * m_axis;
214 tmp = cos1_axis.x() * m_axis.y();
215 res.coeffRef(0,1) = tmp - sin_axis.z();
216 res.coeffRef(1,0) = tmp + sin_axis.z();
218 tmp = cos1_axis.x() * m_axis.z();
219 res.coeffRef(0,2) = tmp + sin_axis.y();
220 res.coeffRef(2,0) = tmp - sin_axis.y();
222 tmp = cos1_axis.y() * m_axis.z();
223 res.coeffRef(1,2) = tmp - sin_axis.x();
224 res.coeffRef(2,1) = tmp + sin_axis.x();
226 res.
diagonal() = (cos1_axis.cwiseProduct(m_axis)).array() + c;
233 #endif // EIGEN_ANGLEAXIS_H