libalmath  1.12
almath/types/alvelocity6d.h
00001 /*
00002 ** Author(s):
00003 **  - Chris Kilner
00004 **  - Cyrille Collette
00005 **  - David Gouaillier
00006 **
00007 ** Copyright (C) 2011 Aldebaran Robotics
00008 */
00009 
00010 
00011 #pragma once
00012 #ifndef _LIBALMATH_ALMATH_TYPES_ALVELOCITY6D_H_
00013 #define _LIBALMATH_ALMATH_TYPES_ALVELOCITY6D_H_
00014 
00015 #include <vector>
00016 
00017 namespace AL {
00018 namespace Math {
00019 
00020 
00027 struct Velocity6D {
00029   float xd;
00031   float yd;
00033   float zd;
00035   float wxd;
00037   float wyd;
00039   float wzd;
00040 
00043 
00062 
00063   Velocity6D();
00064 
00067 
00086 
00087 
00088 
00089   explicit Velocity6D(float pInit);
00090 
00093 
00112 
00113 
00114 
00115 
00116 
00117 
00118 
00119   Velocity6D(
00120     float pXd,
00121     float pYd,
00122     float pZd,
00123     float pWxd,
00124     float pWyd,
00125     float pWzd);
00126 
00129 
00148 
00149 
00150 
00151 
00152 
00153 
00154   Velocity6D(const std::vector<float>& pFloats);
00155 
00160   Velocity6D operator+ (const Velocity6D& pVel2) const;
00161 
00166   Velocity6D operator- (const Velocity6D& pVel2) const;
00167 
00171   Velocity6D operator+ () const;
00172 
00176   Velocity6D operator- () const;
00177 
00182   Velocity6D operator* (const float pVal) const;
00183 
00188   Velocity6D operator/ (const float pVal) const;
00189 
00194   bool operator== (const Velocity6D& pVel2) const;
00195 
00200   bool operator!= (const Velocity6D& pVel2) const;
00201 
00206   Velocity6D& operator*= (const float pVal);
00207 
00212   Velocity6D& operator/= (const float pVal);
00213 
00224   bool isNear(
00225     const Velocity6D& pVel2,
00226     const float&      pEpsilon=0.0001f) const;
00227 
00236   float norm() const;
00237 
00246   Velocity6D normalize() const;
00247 
00251   std::vector<float> toVector() const;
00252 }; // end struct
00253 
00259 Velocity6D operator* (
00260   const float       pVal,
00261   const Velocity6D& pVel);
00262 
00273 float norm(const Velocity6D& pVel);
00274 
00285 Velocity6D normalize(const Velocity6D& pVel);
00286 
00287 } // end namespace Math
00288 } // end namespace AL
00289 #endif  // _LIBALMATH_ALMATH_TYPES_ALVELOCITY6D_H_
 All Classes Namespaces Functions Variables