Skip to content

Instantly share code, notes, and snippets.

@mauriciopoppe
Created April 6, 2016 01:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mauriciopoppe/9a11f02853f3923a668e9138a959bdd3 to your computer and use it in GitHub Desktop.
Save mauriciopoppe/9a11f02853f3923a668e9138a959bdd3 to your computer and use it in GitHub Desktop.
#include <iostream>
#include "project/Vector.hpp"
Vector::Vector() {
x = y = 0.0;
}
Vector::Vector(double a, double b) {
x = a;
y = b;
}
Vector Vector::operator+(const Vector &other) const {
return Vector(x + other.x, y + other.y);
}
void Vector::print() {
std::cout << "(" << x << "," << y << ")" << std::endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment