コード例 #1
0
ファイル: Point2D.php プロジェクト: atelierspierrot/maths
 /**
  * Write a 2D point as `( x , y )`
  *
  * @return  string
  */
 public function __toString()
 {
     return Maths::coordinatesToString(array($this->getAbscissa(), $this->getOrdinate()));
 }
コード例 #2
0
ファイル: Point.php プロジェクト: atelierspierrot/maths
 /**
  * Write a 3D point as `( x , y , z )`
  *
  * @return  string
  */
 public function __toString()
 {
     return Maths::coordinatesToString($this->is3D() ? array($this->getAbscissa(), $this->getOrdinate(), $this->getApplicate()) : ($this->is2D() ? array($this->getAbscissa(), $this->getOrdinate()) : array($this->getAbscissa())));
 }
コード例 #3
0
ファイル: Circle.php プロジェクト: atelierspierrot/maths
 /**
  * Write a circle like `[circ. O(x,y),r=..]`
  *
  * @return  string
  */
 public function __toString()
 {
     return '[circ. O' . Maths::coordinatesToString(array($this->getPointO()->getAbscissa(), $this->getPointO()->getOrdinate())) . ',r=' . $this->getRadius() . ']';
 }
コード例 #4
0
ファイル: Vector.php プロジェクト: atelierspierrot/maths
 /**
  * Write a vector
  *
  * @return  string
  */
 public function __toString()
 {
     return "[~ " . Maths::coordinatesToString(array($this->getPointA()->getAbsissa(), $this->getPointA()->getOrdinate())) . ',' . Maths::coordinatesToString(array($this->getPointB()->getAbsissa(), $this->getPointB()->getOrdinate())) . "]";
 }