fw4spl
VectorFunctions.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2015.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #ifndef __FWMATH_VECTORFUNCTIONS_HPP__
8 #define __FWMATH_VECTORFUNCTIONS_HPP__
9 
10 #include <fwCore/base.hpp>
11 
12 #include "fwMath/IntrasecTypes.hpp"
13 #include "fwMath/config.hpp"
14 
15 namespace fwMath
16 {
17 
21 FWMATH_API double normalize(fwVec3d & vec);
22 
28 FWMATH_API fwVec3d normalized(const fwVec3d & vec);
29 
36 FWMATH_API double dot(const fwVec3d& v1, const fwVec3d& v2);
43 FWMATH_API fwVec3d cross(const fwVec3d& v1, const fwVec3d& v2);
44 
50 FWMATH_API double vecLength(const fwVec3d &_vec);
51 
57 FWMATH_API void negate(fwVec3d &_vec);
58 
59 } //namespace fwMath
60 
67 FWMATH_API fwVec3d& operator*=(fwVec3d& vec1, double val);
68 
75 FWMATH_API fwVec3d& operator/=(fwVec3d& vec, double val );
76 
83 FWMATH_API fwVec3d& operator+=(fwVec3d& vec1, const fwVec3d& vec2);
84 
91 FWMATH_API fwVec3d& operator-=(fwVec3d& vec1, const fwVec3d& vec2);
92 
99 FWMATH_API fwVec3d operator*(const fwVec3d& _vec, double _val);
100 
107 FWMATH_API fwVec3d operator*(const double _val, const fwVec3d& _vec);
108 
115 FWMATH_API fwVec3d operator/(const fwVec3d& _vec, double val);
116 
123 FWMATH_API fwVec3d operator+(const fwVec3d& _vec1, const fwVec3d& _vec2);
124 
131 FWMATH_API fwVec3d operator-(const fwVec3d& _vec1, const fwVec3d& _vec2);
132 
139 FWMATH_API int operator==(const fwVec3d& _vec1, const fwVec3d& _vec2);
140 
147 FWMATH_API int operator!=(const fwVec3d& _vec1, const fwVec3d& _vec2);
148 
149 
150 #endif /* __FWMATH_VECTORFUNCTIONS_HPP__ */
FWMATH_API double vecLength(const fwVec3d &_vec)
Compute the length of the vector.
FWMATH_API fwVec3d normalized(const fwVec3d &vec)
Return a normalized vector.
FWMATH_API fwVec3d cross(const fwVec3d &v1, const fwVec3d &v2)
Compute the Cross product between two vectors.
The namespace fwMath contains classes which provide the implementation of several mathematic function...
Definition: Compare.hpp:12
FWMATH_API void negate(fwVec3d &_vec)
Compute the negate of the vector.
FWMATH_API double dot(const fwVec3d &v1, const fwVec3d &v2)
Compute the Dot product between two vectors.
FWMATH_API double normalize(fwVec3d &vec)
Normalize a vector.