/** * Write a segment as `[(Ax,Ay),(Bx,By)]` * * @return string */ public function __toString() { return Maths::segmentToString($this->is3D() ? array($this->getPointA()->x, $this->getPointA()->y, $this->getPointA()->z) : array($this->getPointA()->x, $this->getPointA()->y), $this->is3D() ? array($this->getPointB()->x, $this->getPointB()->y, $this->getPointB()->z) : array($this->getPointB()->x, $this->getPointB()->y)); }