fix formatting and add comment
This commit is contained in:
parent
0584448a06
commit
f521e2ec48
@ -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");
|
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);
|
return std::sqrt(x * x + y * y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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");
|
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);
|
return std::sqrt(x * x + y * y + z * z);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user