A monte carlo pin cell spectral code for nuclear engineering applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
vector.h
Go to the documentation of this file.
1 
9 #ifndef VECTOR_H_
10 #define VECTOR_H_
11 
12 
22 template <typename T>
23 T dotProduct2D(T x1, T y1, T x2, T y2) {
24  return x1 * x2 + y1 * y2;
25 }
26 
27 
40 template <typename T>
41 T dotProduct3D(T x1, T y1, T z1, T x2, T y2, T z2) {
42  return x1 * x2 + y1 * y2 + z1 * z2;
43 }
44 
45 
54 template <typename T>
55 T norm2D(T x, T y) {
56  return sqrt(x * x + y * y);
57 }
58 
59 
69 template <typename T>
70 T norm3D(T x, T y, T z) {
71  return sqrt(x * x + y * y + z * z);
72 }
73 
74 
75 #endif /* VECTOR_H_ */
T dotProduct2D(T x1, T y1, T x2, T y2)
Computes the dot product of two vectors in the 2D cartesian space.
Definition: vector.h:23
T norm3D(T x, T y, T z)
Computes the norm of a vector in 3D cartesiance space.
Definition: vector.h:70
T dotProduct3D(T x1, T y1, T z1, T x2, T y2, T z2)
Computes the dot product of two vectors in 3D cartesian space.
Definition: vector.h:41
T norm2D(T x, T y)
Computes the norm of a vector in the 2D cartesian space.
Definition: vector.h:55