libalmath  1.14
 All Classes Namespaces Functions Variables Typedefs Groups Pages
alrotation3d.h
1 /*
2  * Copyright (c) 2012 Aldebaran Robotics. All rights reserved.
3  * Use of this source code is governed by a BSD-style license that can be
4  * found in the COPYING file.
5  */
6 
7 
8 #pragma once
9 #ifndef _LIBALMATH_ALMATH_TYPES_ALROTATION3D_H_
10 #define _LIBALMATH_ALMATH_TYPES_ALROTATION3D_H_
11 
12 #include <vector>
13 
14 namespace AL {
15  namespace Math {
16 
21  struct Rotation3D {
23  float wx;
25  float wy;
27  float wz;
28 
31 
44 
45  Rotation3D();
46 
51 
64 
65  explicit Rotation3D(float pInit);
66 
69 
82 
83 
84 
85 
86  Rotation3D(
87  float pWx,
88  float pWy,
89  float pWz);
90 
93 
106 
107 
108 
109 
110 
111  Rotation3D (const std::vector<float>& pFloats);
112 
117  Rotation3D operator+ (const Rotation3D& pRot2) const;
118 
123  Rotation3D operator- (const Rotation3D& pRot2) const;
124 
129  Rotation3D& operator+= (const Rotation3D& pRot2);
130 
135  Rotation3D& operator-= (const Rotation3D& pRot2);
136 
141  bool operator== (const Rotation3D& pRot2) const;
142 
147  bool operator!= (const Rotation3D& pRot2) const;
148 
153  Rotation3D operator* (const float pVal) const;
154 
159  Rotation3D operator/ (const float pVal) const;
160 
165  Rotation3D& operator*= (const float pVal);
166 
171  Rotation3D& operator/= (const float pVal);
172 
183  bool isNear(
184  const Rotation3D& pRot2,
185  const float& pEpsilon=0.0001f) const;
186 
195  float norm() const;
196 
200  std::vector<float> toVector() const;
201  };
202 
213  float norm(const Rotation3D& pRot);
214 
215  } // end namespace Math
216 } // end namespace AL
217 #endif // _LIBALMATH_ALMATH_TYPES_ALROTATION3D_H_