Vector2.hpp 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2022-08-05
  6. * Changed: 2022-08-05
  7. *
  8. * */
  9. #ifndef LS_MATH_VECTOR2_HPP
  10. #define LS_MATH_VECTOR2_HPP
  11. #include <ls-math/core/types/VectorTypes.hpp>
  12. #include <cstdlib>
  13. namespace ls::math::vector
  14. {
  15. class Vector2
  16. {
  17. public:
  18. Vector2(const ls::math::core::type::vector2_component& _x, const ls::math::core::type::vector2_component& _y);
  19. ~Vector2() = default;
  20. // arithmetic operations
  21. ls::math::vector::Vector2 operator+(ls::math::vector::Vector2 _vector);
  22. ls::math::vector::Vector2 operator-(ls::math::vector::Vector2 _vector);
  23. ls::math::core::type::vector_scalar operator*(ls::math::vector::Vector2 _vector);
  24. ls::math::vector::Vector2 operator*(double _value);
  25. // comparison operations
  26. bool operator==(const Vector2& _vector);
  27. bool operator!=(const Vector2& _vector);
  28. // additional functionality
  29. double getLength();
  30. ls::math::core::type::vector2_component getX();
  31. ls::math::core::type::vector2_component getY();
  32. void setX(const ls::math::core::type::vector2_component& _value);
  33. void setY(const ls::math::core::type::vector2_component& _value);
  34. private:
  35. ls::math::core::type::vector2_components components{};
  36. };
  37. }
  38. #endif