libalmath  1.14.5
almath/types/alrotation3d.h
00001 /*
00002  * Copyright (c) 2012 Aldebaran Robotics. All rights reserved.
00003  * Use of this source code is governed by a BSD-style license that can be
00004  * found in the COPYING file.
00005  */
00006 
00007 
00008 #pragma once
00009 #ifndef _LIBALMATH_ALMATH_TYPES_ALROTATION3D_H_
00010 #define _LIBALMATH_ALMATH_TYPES_ALROTATION3D_H_
00011 
00012 #include <vector>
00013 
00014 namespace AL {
00015   namespace Math {
00016 
00021     struct Rotation3D {
00023       float wx;
00025       float wy;
00027       float wz;
00028 
00031 
00044 
00045       Rotation3D();
00046 
00051 
00064 
00065       explicit Rotation3D(float pInit);
00066 
00069 
00082 
00083 
00084 
00085 
00086       Rotation3D(
00087         float pWx,
00088         float pWy,
00089         float pWz);
00090 
00093 
00106 
00107 
00108 
00109 
00110 
00111       Rotation3D (const std::vector<float>& pFloats);
00112 
00117       Rotation3D operator+ (const Rotation3D& pRot2) const;
00118 
00123       Rotation3D operator- (const Rotation3D& pRot2) const;
00124 
00129       Rotation3D& operator+= (const Rotation3D& pRot2);
00130 
00135       Rotation3D& operator-= (const Rotation3D& pRot2);
00136 
00141       bool operator== (const Rotation3D& pRot2) const;
00142 
00147       bool operator!= (const Rotation3D& pRot2) const;
00148 
00153       Rotation3D operator* (const float pVal) const;
00154 
00159       Rotation3D operator/ (const float pVal) const;
00160 
00165       Rotation3D& operator*= (const float pVal);
00166 
00171       Rotation3D& operator/= (const float pVal);
00172 
00183       bool isNear(
00184         const Rotation3D& pRot2,
00185         const float&      pEpsilon=0.0001f) const;
00186 
00195       float norm() const;
00196 
00200       std::vector<float> toVector() const;
00201     };
00202 
00213     float norm(const Rotation3D& pRot);
00214 
00215   } // end namespace Math
00216 } // end namespace AL
00217 #endif  // _LIBALMATH_ALMATH_TYPES_ALROTATION3D_H_
 All Classes Namespaces Functions Variables