Salome HOME
Bug fix: isColinear3D() was using wrongly dimensionned epsilon
[tools/medcoupling.git] / src / INTERP_KERNEL / VectorUtils.hxx
index 47be64cd365835bb54fc3df1c7f9d401d1fec8a7..fb695573968f075d648ef74f596533e0ebd5a21f 100644 (file)
@@ -159,6 +159,16 @@ namespace INTERP_KERNEL
     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;
+  }
 
   /**
    * Compares doubles using a relative tolerance