mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:47:35 +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
|
[[nodiscard]] constexpr T length() const
|
||||||
{
|
{
|
||||||
T squared_sum {};
|
return AK::sqrt(dot(*this));
|
||||||
UNROLL_LOOP
|
|
||||||
for (auto i = 0u; i < N; ++i)
|
|
||||||
squared_sum += m_data[i] * m_data[i];
|
|
||||||
return AK::sqrt(squared_sum);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]] constexpr VectorN<2, T> xy() const requires(N >= 3)
|
[[nodiscard]] constexpr VectorN<2, T> xy() const requires(N >= 3)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue