示例#1
0
文件: Point.php 项目: tarcisio/p2d
 /**
  *  Return true if this point is zero.x = zero.y = 0
  * 
  * @return bool
  */
 public function isZero()
 {
     $eval = Math::isZero($this->x) && Math::isZero($this->y);
     return $eval;
 }
示例#2
0
文件: MathTest.php 项目: tarcisio/p2d
 /**
  * @covers tarcisio\p2d\Math::isZero
  */
 public function testIsZero()
 {
     $this->assertTrue(Math::isZero(0));
     $this->assertTrue(Math::isZero(1.0E-8));
     $this->assertFalse(Math::isZero(1.0E-7));
 }