Lines Matching full:phase

6 from cmath import phase, polar, rect, pi
466 self.assertAlmostEqual(phase(0), 0.)
467 self.assertAlmostEqual(phase(1.), 0.)
468 self.assertAlmostEqual(phase(-1.), pi)
469 self.assertAlmostEqual(phase(-1.+1E-300j), pi)
470 self.assertAlmostEqual(phase(-1.-1E-300j), -pi)
471 self.assertAlmostEqual(phase(1j), pi/2)
472 self.assertAlmostEqual(phase(-1j), -pi/2)
475 self.assertEqual(phase(complex(0.0, 0.0)), 0.0)
476 self.assertEqual(phase(complex(0.0, -0.0)), -0.0)
477 self.assertEqual(phase(complex(-0.0, 0.0)), pi)
478 self.assertEqual(phase(complex(-0.0, -0.0)), -pi)
481 self.assertAlmostEqual(phase(complex(-INF, -0.0)), -pi)
482 self.assertAlmostEqual(phase(complex(-INF, -2.3)), -pi)
483 self.assertAlmostEqual(phase(complex(-INF, -INF)), -0.75*pi)
484 self.assertAlmostEqual(phase(complex(-2.3, -INF)), -pi/2)
485 self.assertAlmostEqual(phase(complex(-0.0, -INF)), -pi/2)
486 self.assertAlmostEqual(phase(complex(0.0, -INF)), -pi/2)
487 self.assertAlmostEqual(phase(complex(2.3, -INF)), -pi/2)
488 self.assertAlmostEqual(phase(complex(INF, -INF)), -pi/4)
489 self.assertEqual(phase(complex(INF, -2.3)), -0.0)
490 self.assertEqual(phase(complex(INF, -0.0)), -0.0)
491 self.assertEqual(phase(complex(INF, 0.0)), 0.0)
492 self.assertEqual(phase(complex(INF, 2.3)), 0.0)
493 self.assertAlmostEqual(phase(complex(INF, INF)), pi/4)
494 self.assertAlmostEqual(phase(complex(2.3, INF)), pi/2)
495 self.assertAlmostEqual(phase(complex(0.0, INF)), pi/2)
496 self.assertAlmostEqual(phase(complex(-0.0, INF)), pi/2)
497 self.assertAlmostEqual(phase(complex(-2.3, INF)), pi/2)
498 self.assertAlmostEqual(phase(complex(-INF, INF)), 0.75*pi)
499 self.assertAlmostEqual(phase(complex(-INF, 2.3)), pi)
500 self.assertAlmostEqual(phase(complex(-INF, 0.0)), pi)
504 self.assertTrue(math.isnan(phase(z)))