You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

vector2d.h 623B

123456789101112131415161718192021222324252627282930
  1. #ifndef VECTOR2D_H
  2. #define VECTOR2D_H
  3. #include "vectorxd.h"
  4. class Vector2D : public VectorXD<2>
  5. {
  6. public:
  7. explicit Vector2D(double x = 0.0, double y = 0.0);
  8. Vector2D(const Vector2D& other);
  9. Vector2D(const VectorXD<2>& other);
  10. virtual ~Vector2D();
  11. double getX() const;
  12. Vector2D& setX(double x);
  13. double getY() const;
  14. Vector2D& setY(double y);
  15. using VectorXD<2>::add;
  16. Vector2D& add(double x, double y);
  17. using VectorXD<2>::sub;
  18. Vector2D& sub(double x, double y);
  19. using VectorXD<2>::dotProduct;
  20. double dotProduct(double x, double y) const;
  21. };
  22. #endif // VECTOR2D_H