This commit is contained in:
2025-05-03 21:36:16 +03:00
parent 31d3359507
commit 449c60133c
2 changed files with 7 additions and 7 deletions

View File

@@ -134,14 +134,14 @@ namespace omath
return len > 0.f ? *this / len : *this; return len > 0.f ? *this / len : *this;
} }
#else #else
[[nodiscard]] Type Length() const [[nodiscard]] Type length() const
{ {
return std::hypot(x, y); return std::hypot(x, y);
} }
[[nodiscard]] Vector2 Normalized() const [[nodiscard]] Vector2 normalized() const
{ {
const Type len = Length(); const Type len = length();
return len > 0.f ? *this / len : *this; return len > 0.f ? *this / len : *this;
} }
#endif #endif

View File

@@ -149,19 +149,19 @@ namespace omath
[[nodiscard]] Vector3 normalized() const [[nodiscard]] Vector3 normalized() const
{ {
const Type length = this->Length(); const Type len = this->length();
return length != 0 ? *this / length : *this; return len != 0 ? *this / len : *this;
} }
[[nodiscard]] Type length_2d() const [[nodiscard]] Type length_2d() const
{ {
return Vector2<Type>::Length(); return Vector2<Type>::length();
} }
[[nodiscard]] Type distance_to(const Vector3& vOther) const [[nodiscard]] Type distance_to(const Vector3& vOther) const
{ {
return (*this - vOther).Length(); return (*this - vOther).length();
} }
#endif #endif