+
+ /**
+ * Test whether two 3D vectors are colinear. The two vectors are expected to be of unit norm (not checked)
+ * Implemented by checking that the norm of the cross product is null.
+ */
+ inline bool isColinear3D(const double *v1, const double *v2, const double eps = DEFAULT_ABS_TOL)
+ {
+ double cros[3];
+ cross(v1, v2, cros);
+ return epsilonEqual(dot(cros, cros), 0.0, eps);
+ }
+
+ /**
+ * Caracteristic vector size (its biggest component, in absolute)
+ */
+ inline double caracteristicDimVector(const double *v)
+ {
+ double ret = 0;
+ for (int i = 0; i < 3; i++)
+ ret = std::max(ret, std::fabs(v[i]));
+ return ret;
+ }
+