fix formatting and add comment

This commit is contained in:
LDprg 2022-09-06 09:59:21 +02:00 committed by Vittorio Romeo
parent 0584448a06
commit f521e2ec48
2 changed files with 5 additions and 3 deletions

View File

@ -107,6 +107,7 @@ T Vector2<T>::length() const
{
static_assert(std::is_floating_point_v<T>, "Vector2::length() is only supported for floating point types");
// don't use std::hypot because of slow performance
return std::sqrt(x * x + y * y);
}

View File

@ -48,6 +48,7 @@ T Vector3<T>::length() const
{
static_assert(std::is_floating_point_v<T>, "Vector3::length() is only supported for floating point types");
// don't use std::hypot because of slow performance
return std::sqrt(x * x + y * y + z * z);
}