/** * Move point by sent value. * * @param int|float $x Move vector on OX axis. * @param int|float $y Move vector on OY axis. * @param int|float $z Move vector on OY axis. * @return Point3D Method returns current object instance. */ public function move($x = 0, $y = 0, $z = 0) { parent::move($x, $y); $this->checkZ($z); $this->z += $z; return $this; }
public function testPoint3DEquals() { $point3D = new Point2D(16, 18, 20); $this->assertTrue($point3D->equals($point3D)); $this->assertFalse($point3D->equals(new Point3D(16, 18, 20))); $this->assertFalse($point3D->equals(new Point3D(16, -1, 20))); $this->assertTrue($point3D->equals($point3D->move(0, 0, 5))); }