GteEulerAngles.h
Go to the documentation of this file.
1 // David Eberly, Geometric Tools, Redmond WA 98052
2 // Copyright (c) 1998-2017
3 // Distributed under the Boost Software License, Version 1.0.
4 // http://www.boost.org/LICENSE_1_0.txt
5 // http://www.geometrictools.com/License/Boost/LICENSE_1_0.txt
6 // File Version: 3.0.0 (2016/06/19)
7 
8 #pragma once
9 
10 #include <Mathematics/GteVector.h>
11 
12 namespace gte
13 {
14 
15 // Factorization into Euler angles is not necessarily unique. Let the
16 // integer indices for the axes be (N0,N1,N2), which must be in the set
17 // {(0,1,2),(0,2,1),(1,0,2),(1,2,0),(2,0,1),(2,1,0),
18 // (0,1,0),(0,2,0),(1,0,1),(1,2,1),(2,0,2),(2,1,2)}
19 // Let the corresponding angles be (angleN0,angleN1,angleN2). If the
20 // result is ER_NOT_UNIQUE_SUM, then the multiple solutions occur because
21 // angleN2+angleN0 is constant. If the result is ER_NOT_UNIQUE_DIF, then
22 // the multiple solutions occur because angleN2-angleN0 is constant. In
23 // either type of nonuniqueness, the function returns angleN0=0.
25 {
26  // The solution is invalid (incorrect axis indices).
28 
29  // The solution is unique.
31 
32  // The solution is not unique. A sum of angles is constant.
34 
35  // The solution is not unique. A difference of angles is constant.
37 };
38 
39 template <typename Real>
41 {
42 public:
43  EulerAngles();
44  EulerAngles(int i0, int i1, int i2, Real a0, Real a1, Real a2);
45 
46  int axis[3];
47  Real angle[3];
48 
49  // This member is set during conversions from rotation matrices,
50  // quaternions, or axis-angles.
52 };
53 
54 
55 template <typename Real>
57  :
59 {
60  for (int i = 0; i < 3; ++i)
61  {
62  axis[i] = 0;
63  angle[i] = (Real)0;
64  }
65 }
66 
67 template <typename Real>
68 EulerAngles<Real>::EulerAngles(int i0, int i1, int i2, Real a0, Real a1,
69  Real a2)
70  :
72 {
73  axis[0] = i0;
74  axis[1] = i1;
75  axis[2] = i2;
76  angle[0] = a0;
77  angle[1] = a1;
78  angle[2] = a2;
79 }
80 
81 
82 }
GLfloat angle
Definition: glext.h:6466
EulerResult result
GLuint64EXT * result
Definition: glext.h:10003


geometric_tools_engine
Author(s): Yijiang Huang
autogenerated on Thu Jul 18 2019 03:59:59