|
@@ -18,20 +18,12 @@ ls::math::vector::Vector2::Vector2(const ls::math::core::type::vector2_component
|
|
|
|
|
|
ls::math::vector::Vector2 ls::math::vector::Vector2::operator+(ls::math::vector::Vector2 _vector)
|
|
ls::math::vector::Vector2 ls::math::vector::Vector2::operator+(ls::math::vector::Vector2 _vector)
|
|
{
|
|
{
|
|
- ls::math::vector::Vector2 calculatedVector{0, 0};
|
|
|
|
- calculatedVector.setX(this->components[0] + _vector.getX());
|
|
|
|
- calculatedVector.setY(this->components[1] + _vector.getY());
|
|
|
|
-
|
|
|
|
- return calculatedVector;
|
|
|
|
|
|
+ return ls::math::vector::Vector2{this->components[0] + _vector.getX(), this->components[1] + _vector.getY()};
|
|
}
|
|
}
|
|
|
|
|
|
ls::math::vector::Vector2 ls::math::vector::Vector2::operator-(ls::math::vector::Vector2 _vector)
|
|
ls::math::vector::Vector2 ls::math::vector::Vector2::operator-(ls::math::vector::Vector2 _vector)
|
|
{
|
|
{
|
|
- ls::math::vector::Vector2 calculatedVector{0, 0};
|
|
|
|
- calculatedVector.setX(this->components[0] - _vector.getX());
|
|
|
|
- calculatedVector.setY(this->components[1] - _vector.getY());
|
|
|
|
-
|
|
|
|
- return calculatedVector;
|
|
|
|
|
|
+ return ls::math::vector::Vector2{this->components[0] - _vector.getX(), this->components[1] - _vector.getY()};
|
|
}
|
|
}
|
|
|
|
|
|
ls::math::core::type::vector_scalar ls::math::vector::Vector2::operator*(ls::math::vector::Vector2 _vector)
|
|
ls::math::core::type::vector_scalar ls::math::vector::Vector2::operator*(ls::math::vector::Vector2 _vector)
|
|
@@ -41,11 +33,7 @@ ls::math::core::type::vector_scalar ls::math::vector::Vector2::operator*(ls::mat
|
|
|
|
|
|
ls::math::vector::Vector2 ls::math::vector::Vector2::operator*(double _value)
|
|
ls::math::vector::Vector2 ls::math::vector::Vector2::operator*(double _value)
|
|
{
|
|
{
|
|
- ls::math::vector::Vector2 calculatedVector{0, 0};
|
|
|
|
- calculatedVector.setX(components[0] * _value);
|
|
|
|
- calculatedVector.setY(components[1] * _value);
|
|
|
|
-
|
|
|
|
- return calculatedVector;
|
|
|
|
|
|
+ return ls::math::vector::Vector2{components[0] * _value, components[1] * _value};
|
|
}
|
|
}
|
|
|
|
|
|
ls::math::vector::Vector2 ls::math::vector::Vector2::operator/(double _value)
|
|
ls::math::vector::Vector2 ls::math::vector::Vector2::operator/(double _value)
|