public function subtract($x, $y = 0) { if ($x instanceof Vector2) { return $this->add(-$x->x, -$x->y); } else { return $this->add(-$x, -$y); } }