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 765B

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