|
@@ -8,6 +8,7 @@
|
|
|
* */
|
|
|
|
|
|
#include <ls-math/vector/Vector2.hpp>
|
|
|
+#include <math.h>
|
|
|
|
|
|
ls::math::vector::Vector2::Vector2(const ls::math::core::type::vector2_component &_x, const ls::math::core::type::vector2_component &_y)
|
|
|
{
|
|
@@ -57,6 +58,11 @@ bool ls::math::vector::Vector2::operator!=(const ls::math::vector::Vector2 &_vec
|
|
|
return this->components[0] != _vector.components[0] || this->components[1] != _vector.components[1];
|
|
|
}
|
|
|
|
|
|
+double ls::math::vector::Vector2::getLength()
|
|
|
+{
|
|
|
+ return sqrt(this->components[0] * this->components[0] + this->components[1] * this->components[1]);
|
|
|
+}
|
|
|
+
|
|
|
ls::math::core::type::vector2_component ls::math::vector::Vector2::getX()
|
|
|
{
|
|
|
return this->components[0];
|