function Vector2D(x, y) {
	this.x = x;
	this.y = y;
}

Vector2D.prototype.add = function(vector) {
	return new Vector2D(this.x + vector.x, this.y + vector.y);
}

Vector2D.prototype.subtract = function(vector) {
	return new Vector2D(this.x - vector.x, this.y - vector.y);
}

Vector2D.prototype.scale = function(factor) {
	return new Vector2D(this.x * factor.x, this.y * factor);
}
