x = (float)$x; $this->y = (float)$y; } /** * @return float */ public function getX() { return $this->x; } /** * @return float */ public function getY() { return $this->y; } /** * @param Matrix $matrix * @return Vector */ public function multiplyWithMatrix(Matrix $matrix) { list($a, $b, $c, $d, $e, $f) = $matrix->getValues(); $x = $a * $this->x + $c * $this->y + $e; $y = $b * $this->x + $d * $this->y + $f; return new self($x, $y); } }