/** * Move point by sent value. * * @param int|float $x Move vector on OX axis. * @param int|float $y Move vector on OY axis. * @return Point2D Method returns current object instance. */ public function move($x = 0, $y = 0) { parent::move($x); $this->checkY($y); $this->y += $y; return $this; }
public function testPoint1DMove() { $point1D = new Point1D(1.3); $this->assertEquals($point1D->x + 5, $point1D->move(5)->x); $this->assertEquals($point1D->x - 13.25, $point1D->move(-13.25)->x); }