IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
Vector3d.h
Go to the documentation of this file.
1 // Vector3d.h:
3 // -----------
4 //
14 
15 #ifndef __IPSDKMATH_VECTOR3D_H__
16 #define __IPSDKMATH_VECTOR3D_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, const T z)
33 {
34  return std::sqrt(x*x + y*y + z*z);
35 }
36 
38 template <typename T>
39 IPSDK_FORCEINLINE T
40 scalarProduct(const T x1, const T y1, const T z1,
41  const T x2, const T y2, const T z2)
42 {
43  return x1*x2 + y1*y2 + z1*z2;
44 }
45 
47 template <typename T>
48 IPSDK_FORCEINLINE void
49 crossProduct(const T x1, const T y1, const T z1,
50  const T x2, const T y2, const T z2,
51  T& xRes, T& yRes, T& zRes)
52 {
53  xRes = y1*z2 - z1*y2;
54  yRes = z1*x2 - x1*z2;
55  zRes = x1*y2 - y1*x2;
56 }
57 
60 
61 } // end of namespace math
62 } // end of namespace ipsdk
63 
64 #endif // __IPSDKMATH_VECTOR3D_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 void crossProduct(const T x1, const T y1, const T z1, const T x2, const T y2, const T z2, T &xRes, T &yRes, T &zRes)
Cross product of two 3d vectors.
Definition: Vector3d.h:49
IPSDK_FORCEINLINE ipReal64 normL2(const T x, const T y)
L2 norm of a 2d vector.
Definition: Vector2d.h:32