public function divideArray(array $xy) { list($x, $y) = PointUtil::parseArray($xy); if ($x) { MathUtil::validateDivisor($x); $this->x /= $x; } if ($y) { MathUtil::validateDivisor($y); $this->y /= $y; } return $this; }
public function withDividedArray(array $xy) { list($x, $y) = PointUtil::parseArray($xy); $point = clone $this; if ($x) { MathUtil::validateDivisor($x); $point->withDividedX($x); } if ($y) { MathUtil::validateDivisor($y); $point->withDividedY($y); } return $point; }