Ejemplo n.º 1
0
 public function testCanComputeNonAnalytic()
 {
     $z = new Complex(1, 2);
     $accuracy = 1.0E-9;
     $this->assertEquals(sqrt(5), $z->abs(), 'abs', $accuracy);
     $this->assertEquals(1, $z->r(), 'r', $accuracy);
     $this->assertEquals(2, $z->i(), 'i', $accuracy);
     $this->assertEquals(1.107148718, $z->arg(), 'arg', $accuracy);
 }