libalmath
1.14.5
|
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_ALVELOCITY6D_H_ 00010 #define _LIBALMATH_ALMATH_TYPES_ALVELOCITY6D_H_ 00011 00012 #include <vector> 00013 00014 namespace AL { 00015 namespace Math { 00016 00017 00024 struct Velocity6D { 00026 float xd; 00028 float yd; 00030 float zd; 00032 float wxd; 00034 float wyd; 00036 float wzd; 00037 00040 00059 00060 Velocity6D(); 00061 00064 00083 00084 00085 00086 explicit Velocity6D(float pInit); 00087 00090 00109 00110 00111 00112 00113 00114 00115 00116 Velocity6D( 00117 float pXd, 00118 float pYd, 00119 float pZd, 00120 float pWxd, 00121 float pWyd, 00122 float pWzd); 00123 00126 00145 00146 00147 00148 00149 00150 00151 Velocity6D(const std::vector<float>& pFloats); 00152 00157 Velocity6D operator+ (const Velocity6D& pVel2) const; 00158 00163 Velocity6D operator- (const Velocity6D& pVel2) const; 00164 00168 Velocity6D operator+ () const; 00169 00173 Velocity6D operator- () const; 00174 00179 Velocity6D operator* (const float pVal) const; 00180 00185 Velocity6D operator/ (const float pVal) const; 00186 00191 bool operator== (const Velocity6D& pVel2) const; 00192 00197 bool operator!= (const Velocity6D& pVel2) const; 00198 00203 Velocity6D& operator*= (const float pVal); 00204 00209 Velocity6D& operator/= (const float pVal); 00210 00221 bool isNear( 00222 const Velocity6D& pVel2, 00223 const float& pEpsilon=0.0001f) const; 00224 00233 float norm() const; 00234 00243 Velocity6D normalize() const; 00244 00248 std::vector<float> toVector() const; 00249 }; // end struct 00250 00256 Velocity6D operator* ( 00257 const float pVal, 00258 const Velocity6D& pVel); 00259 00270 float norm(const Velocity6D& pVel); 00271 00282 Velocity6D normalize(const Velocity6D& pVel); 00283 00284 } // end namespace Math 00285 } // end namespace AL 00286 #endif // _LIBALMATH_ALMATH_TYPES_ALVELOCITY6D_H_