示例#1
0
文件: Line.php 项目: tarcisio/p2d
 public function distance()
 {
     return Math::distance($this->start->x, $this->start->y, $this->end->x, $this->end->y);
 }
示例#2
0
文件: MathTest.php 项目: tarcisio/p2d
 /**
  * @covers tarcisio\p2d\Math::distance
  */
 public function testDistance()
 {
     $p1 = new Point(0, 0);
     $p2 = new Point(10, 0);
     $this->assertEquals(10, Math::distance($p1->x, $p1->y, $p2->x, $p2->y));
 }