public function normalize() { $len = $this->lengthSquared(); if ($len != 0) { return $this->divide(sqrt($len)); } return new Vector2(0, 0); }