Commit 49c7198b authored by Philip Trettner's avatar Philip Trettner
Browse files

fix for distance(ipos, ipos)

parent c4d093bc
......@@ -10,9 +10,10 @@ namespace tg
{
// Base case for vec
template <int D, class ScalarT>
[[nodiscard]] constexpr ScalarT length_sqr(vec<D, ScalarT> const& v)
[[nodiscard]] constexpr fractional_result<ScalarT> length_sqr(vec<D, ScalarT> const& v)
{
return dot(v, v);
auto const fv = vec<D, fractional_result<ScalarT>>(v);
return dot(fv, fv);
}
template <int D, class ScalarT>
[[deprecated("length of a position is ill-defined. did you mean length(vec)?")]] [[nodiscard]] constexpr ScalarT length_sqr(pos<D, ScalarT> const& v)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment