mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:48:12 +00:00
LibGfx: Use VectorN
dot product of self for length()
No functional changes.
This commit is contained in:
parent
582fb3f263
commit
dfe002cfd4
1 changed files with 1 additions and 5 deletions
|
@ -201,11 +201,7 @@ public:
|
|||
|
||||
[[nodiscard]] constexpr T length() const
|
||||
{
|
||||
T squared_sum {};
|
||||
UNROLL_LOOP
|
||||
for (auto i = 0u; i < N; ++i)
|
||||
squared_sum += m_data[i] * m_data[i];
|
||||
return AK::sqrt(squared_sum);
|
||||
return AK::sqrt(dot(*this));
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr VectorN<2, T> xy() const requires(N >= 3)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue