#include "vector2d.h" Vector2D::Vector2D(double x, double y) : VectorXD<2>() { _scalars[0] = x; _scalars[1] = y; } Vector2D::Vector2D(const Vector2D &other) : VectorXD<2>(other) { } Vector2D::Vector2D(const VectorXD<2> &other) : VectorXD<2>(other) { } Vector2D::~Vector2D() { } double Vector2D::getX() const { return _scalars[0]; } Vector2D& Vector2D::setX(double x) { _scalars[0] = x; return *this; } double Vector2D::getY() const { return _scalars[1]; } Vector2D& Vector2D::setY(double y) { _scalars[1] = y; return *this; } Vector2D &Vector2D::add(double x, double y) { _scalars[0] += x; _scalars[1] += y; return *this; } Vector2D &Vector2D::sub(double x, double y) { _scalars[0] -= x; _scalars[1] -= y; return *this; } double Vector2D::dotProduct(double x, double y) const { return dotProduct(Vector2D(x, y)); }