Skip to content
Snippets Groups Projects
Commit fceee853 authored by Philip Trettner's avatar Philip Trettner
Browse files

Merge branch 'feature/relative-eps' into 'develop'

Feature/relative eps

See merge request !79
parents 3ef9d370 69649b8a
No related branches found
No related tags found
1 merge request!79Feature/relative eps
......@@ -5,6 +5,7 @@
#include <typed-geometry/functions/basic/constants.hh>
#include <typed-geometry/functions/basic/scalar_math.hh>
#include <typed-geometry/functions/basic/minmax.hh>
#include <typed-geometry/functions/vector/cross.hh>
#include <typed-geometry/functions/vector/dot.hh>
......@@ -31,7 +32,7 @@ template <int D, class ScalarT, class = enable_if<is_floating_point<ScalarT>>>
template <int D, class ScalarT>
[[nodiscard]] constexpr bool are_orthogonal(vec<D, ScalarT> const& a, vec<D, ScalarT> const& b, ScalarT eps = 100 * D * tg::epsilon<ScalarT>)
{
return abs(dot(a, b)) < eps;
return abs(dot(a, b)) < max(max_element(abs(a)), max_element(abs(b))) * eps;
}
template <int D, class ScalarT>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment