10#ifndef EIGEN_ANGLEAXIS_H
11#define EIGEN_ANGLEAXIS_H
14#include "./InternalHeaderCheck.h"
45template <
typename Scalar_>
46struct traits<AngleAxis<Scalar_> > {
47 typedef Scalar_ Scalar;
51template <
typename Scalar_>
56 using Base::operator*;
77 template <
typename Derived>
83 template <
typename QuatDerived>
88 template <
typename Derived>
99 EIGEN_DEVICE_FUNC
const Vector3&
axis()
const {
return m_axis; }
124 template <
class QuatDerived>
126 template <
typename Derived>
129 template <
typename Derived>
138 template <
typename NewScalarType>
139 EIGEN_DEVICE_FUNC
inline typename internal::cast_return_type<AngleAxis, AngleAxis<NewScalarType> >::type
cast()
141 return typename internal::cast_return_type<AngleAxis, AngleAxis<NewScalarType> >::type(*
this);
145 template <
typename OtherScalarType>
157 EIGEN_DEVICE_FUNC
bool isApprox(
const AngleAxis& other,
const typename NumTraits<Scalar>::Real& prec =
159 return m_axis.isApprox(other.m_axis, prec) && internal::isApprox(m_angle, other.m_angle, prec);
176template <
typename Scalar>
177template <
typename QuatDerived>
179 EIGEN_USING_STD(atan2)
185 m_angle =
Scalar(2) * atan2(n, abs(q.
w()));
187 m_axis = q.
vec() / n;
197template <
typename Scalar>
198template <
typename Derived>
208template <
typename Scalar>
209template <
typename Derived>
216template <
typename Scalar>
221 Vector3 sin_axis = sin(m_angle) * m_axis;
226 tmp = cos1_axis.x() * m_axis.y();
227 res.
coeffRef(0, 1) = tmp - sin_axis.z();
228 res.
coeffRef(1, 0) = tmp + sin_axis.z();
230 tmp = cos1_axis.x() * m_axis.z();
231 res.
coeffRef(0, 2) = tmp + sin_axis.y();
232 res.
coeffRef(2, 0) = tmp - sin_axis.y();
234 tmp = cos1_axis.y() * m_axis.z();
235 res.
coeffRef(1, 2) = tmp - sin_axis.x();
236 res.
coeffRef(2, 1) = tmp + sin_axis.x();
238 res.
diagonal() = (cos1_axis.cwiseProduct(m_axis)).array() + c;
Represents a 3D rotation as a rotation angle around an arbitrary 3D axis.
Definition AngleAxis.h:52
QuaternionType operator*(const QuaternionType &other) const
Definition AngleAxis.h:112
AngleAxis(const AngleAxis< OtherScalarType > &other)
Definition AngleAxis.h:146
Scalar_ Scalar
Definition AngleAxis.h:60
QuaternionType operator*(const AngleAxis &other) const
Definition AngleAxis.h:107
Scalar & angle()
Definition AngleAxis.h:96
Vector3 & axis()
Definition AngleAxis.h:104
AngleAxis(const QuaternionBase< QuatDerived > &q)
Definition AngleAxis.h:84
internal::cast_return_type< AngleAxis, AngleAxis< NewScalarType > >::type cast() const
Definition AngleAxis.h:139
AngleAxis(const Scalar &angle, const MatrixBase< Derived > &axis)
Definition AngleAxis.h:78
AngleAxis(const MatrixBase< Derived > &m)
Definition AngleAxis.h:89
AngleAxis inverse() const
Definition AngleAxis.h:122
const Vector3 & axis() const
Definition AngleAxis.h:99
AngleAxis()
Definition AngleAxis.h:71
bool isApprox(const AngleAxis &other, const typename NumTraits< Scalar >::Real &prec=NumTraits< Scalar >::dummy_precision()) const
Definition AngleAxis.h:157
friend QuaternionType operator*(const QuaternionType &a, const AngleAxis &b)
Definition AngleAxis.h:117
Matrix3 toRotationMatrix(void) const
Definition AngleAxis.h:217
Scalar angle() const
Definition AngleAxis.h:94
Base class for all dense matrices, vectors, and expressions.
Definition MatrixBase.h:52
static const BasisReturnType UnitX()
Definition CwiseNullaryOp.h:895
DiagonalReturnType diagonal()
Definition Diagonal.h:162
The matrix class, also used for vectors and row-vectors.
Definition Matrix.h:186
constexpr Scalar & coeffRef(Index rowId, Index colId)
Definition PlainObjectBase.h:217
Base class for quaternion expressions.
Definition Quaternion.h:35
const VectorBlock< const Coefficients, 3 > vec() const
Definition Quaternion.h:78
EIGEN_CONSTEXPR CoeffReturnType w() const
Definition Quaternion.h:66
The quaternion class used to represent 3D orientations and rotations.
Definition Quaternion.h:285
Common base class for compact rotation representations.
Definition RotationBase.h:32
Namespace containing all symbols from the Eigen library.
Definition Core:137
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
Definition Meta.h:523