IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
Vector2d.h
Go to the documentation of this file.
1 // Vector2d.h:
3 // -----------
4 //
14 
15 #ifndef __IPSDKMATH_VECTOR2D_H__
16 #define __IPSDKMATH_VECTOR2D_H__
17 
19 #include <IPSDKMath/Constants.h>
20 #include <IPSDKUtil/BaseTypes.h>
22 
23 namespace ipsdk {
24 namespace math {
25 
28 
30 template <typename T>
31 IPSDK_FORCEINLINE ipReal64
32 normL2(const T x, const T y)
33 {
34  return std::sqrt(x*x + y*y);
35 }
36 
38 template <typename T>
39 IPSDK_FORCEINLINE T
40 scalarProduct(const T x1, const T y1,
41  const T x2, const T y2)
42 {
43  return x1*x2 + y1*y2;
44 }
45 
48 
49 } // end of namespace math
50 } // end of namespace ipsdk
51 
52 #endif // __IPSDKMATH_VECTOR2D_H__
Definition of import/export macro for library.
Defines the IPSDK_FORCEINLINE.
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
IPSDK_FORCEINLINE PackT sqrt(const PackT &in)
returns the square root of a pack
Definition: sqrt.h:40
double ipReal64
Base types definition.
Definition: BaseTypes.h:57
Predefined constants for ipsdk math library.
Base types for multiplatform compatibility.
IPSDK_FORCEINLINE T scalarProduct(const T x1, const T y1, const T x2, const T y2)
Scalar product of two 2d vectors.
Definition: Vector2d.h:40
IPSDK_FORCEINLINE ipReal64 normL2(const T x, const T y)
L2 norm of a 2d vector.
Definition: Vector2d.h:32