10 #ifndef EIGEN_EULERSYSTEM_H 11 #define EIGEN_EULERSYSTEM_H 16 template <
typename _Scalar,
class _System>
22 template <
int Num,
bool IsPositive = (Num > 0)>
29 struct Abs<Num, false>
41 #define EIGEN_EULER_ANGLES_CLASS_STATIC_ASSERT(COND,MSG) typedef char static_assertion_##MSG[(COND)?1:-1] 119 template <
int _AlphaAxis,
int _BetaAxis,
int _GammaAxis>
127 static const int AlphaAxis = _AlphaAxis;
130 static const int BetaAxis = _BetaAxis;
133 static const int GammaAxis = _GammaAxis;
141 IsAlphaOpposite = (AlphaAxis < 0) ? 1 : 0,
142 IsBetaOpposite = (BetaAxis < 0) ? 1 : 0,
143 IsGammaOpposite = (GammaAxis < 0) ? 1 : 0,
145 IsOdd = ((AlphaAxisAbs)%3 == (BetaAxisAbs - 1)%3) ? 0 : 1,
146 IsEven = IsOdd ? 0 : 1,
148 IsTaitBryan = ((unsigned)AlphaAxisAbs != (
unsigned)GammaAxisAbs) ? 1 : 0
154 ALPHA_AXIS_IS_INVALID);
157 BETA_AXIS_IS_INVALID);
160 GAMMA_AXIS_IS_INVALID);
163 ALPHA_AXIS_CANT_BE_EQUAL_TO_BETA_AXIS);
166 BETA_AXIS_CANT_BE_EQUAL_TO_GAMMA_AXIS);
173 I = AlphaAxisAbs - 1,
174 J = (AlphaAxisAbs - 1 + 1 + IsOdd)%3,
175 K = (AlphaAxisAbs - 1 + 2 - IsOdd)%3
179 template <
typename Derived>
207 template <
typename Derived>
250 template<
typename Scalar>
255 CalcEulerAngles(res, mat,
false,
false,
false);
259 bool PositiveRangeAlpha,
260 bool PositiveRangeBeta,
261 bool PositiveRangeGamma,
267 CalcEulerAngles(res, mat, PositiveRangeAlpha, PositiveRangeBeta, PositiveRangeGamma);
270 template<
typename Scalar>
274 bool PositiveRangeAlpha,
275 bool PositiveRangeBeta,
276 bool PositiveRangeGamma)
282 if (IsAlphaOpposite == IsOdd)
285 if (IsBetaOpposite == IsOdd)
288 if (IsGammaOpposite == IsOdd)
292 if (PositiveRangeAlpha && (res.
alpha() < 0))
295 if (PositiveRangeBeta && (res.
beta() < 0))
298 if (PositiveRangeGamma && (res.
gamma() < 0))
302 template <
typename _Scalar,
class _System>
306 #define EIGEN_EULER_SYSTEM_TYPEDEF(A, B, C) \ 308 typedef EulerSystem<EULER_##A, EULER_##B, EULER_##C> EulerSystem##A##B##C; 326 #endif // EIGEN_EULERSYSTEM_H
Represents a fixed Euler rotation system.
static void CalcEulerAngles(EulerAngles< Scalar, EulerSystem > &res, const typename EulerAngles< Scalar, EulerSystem >::Matrix3 &mat)
Namespace containing all symbols from the Eigen library.
static Cal3_S2 K(500, 500, 0.1, 640/2, 480/2)
internal::traits< Derived >::Scalar Scalar
static void CalcEulerAngles(EulerAngles< Scalar, EulerSystem > &res, const typename EulerAngles< Scalar, EulerSystem >::Matrix3 &mat)
static void CalcEulerAngles_imp(Matrix< typename MatrixBase< Derived >::Scalar, 3, 1 > &res, const MatrixBase< Derived > &mat, internal::true_type)
cout<< "Here is the matrix m:"<< endl<< m<< endl;Matrix< ptrdiff_t, 3, 1 > res
EIGEN_DEVICE_FUNC const CosReturnType cos() const
#define EIGEN_EULER_ANGLES_CLASS_STATIC_ASSERT(COND, MSG)
Represents a rotation in a 3 dimensional space as three Euler angles.
const Vector3 & angles() const
JacobiRotation< float > J
#define EIGEN_EULER_SYSTEM_TYPEDEF(A, B, C)
Jet< T, N > atan2(const Jet< T, N > &g, const Jet< T, N > &f)
static void CalcEulerAngles(EulerAngles< Scalar, EulerSystem > &res, const typename EulerAngles< Scalar, EulerSystem >::Matrix3 &mat, bool PositiveRangeAlpha, bool PositiveRangeBeta, bool PositiveRangeGamma)
static void CalcEulerAngles_imp(Matrix< typename MatrixBase< Derived >::Scalar, 3, 1 > &res, const MatrixBase< Derived > &mat, internal::false_type)
const AutoDiffScalar< Matrix< typename internal::traits< typename internal::remove_all< DerTypeA >::type >::Scalar, Dynamic, 1 > > atan2(const AutoDiffScalar< DerTypeA > &a, const AutoDiffScalar< DerTypeB > &b)
EIGEN_DEVICE_FUNC const SinReturnType sin() const
The matrix class, also used for vectors and row-vectors.
Base class for all dense matrices, vectors, and expressions.
EulerAxis
Representation of a fixed signed rotation axis for EulerSystem.