Lines Matching full:phase
5 from cmath import phase, polar, rect, pi
398 self.assertAlmostEqual(phase(0), 0.)
399 self.assertAlmostEqual(phase(1.), 0.)
400 self.assertAlmostEqual(phase(-1.), pi)
401 self.assertAlmostEqual(phase(-1.+1E-300j), pi)
402 self.assertAlmostEqual(phase(-1.-1E-300j), -pi)
403 self.assertAlmostEqual(phase(1j), pi/2)
404 self.assertAlmostEqual(phase(-1j), -pi/2)
407 self.assertEqual(phase(complex(0.0, 0.0)), 0.0)
408 self.assertEqual(phase(complex(0.0, -0.0)), -0.0)
409 self.assertEqual(phase(complex(-0.0, 0.0)), pi)
410 self.assertEqual(phase(complex(-0.0, -0.0)), -pi)
413 self.assertAlmostEqual(phase(complex(-INF, -0.0)), -pi)
414 self.assertAlmostEqual(phase(complex(-INF, -2.3)), -pi)
415 self.assertAlmostEqual(phase(complex(-INF, -INF)), -0.75*pi)
416 self.assertAlmostEqual(phase(complex(-2.3, -INF)), -pi/2)
417 self.assertAlmostEqual(phase(complex(-0.0, -INF)), -pi/2)
418 self.assertAlmostEqual(phase(complex(0.0, -INF)), -pi/2)
419 self.assertAlmostEqual(phase(complex(2.3, -INF)), -pi/2)
420 self.assertAlmostEqual(phase(complex(INF, -INF)), -pi/4)
421 self.assertEqual(phase(complex(INF, -2.3)), -0.0)
422 self.assertEqual(phase(complex(INF, -0.0)), -0.0)
423 self.assertEqual(phase(complex(INF, 0.0)), 0.0)
424 self.assertEqual(phase(complex(INF, 2.3)), 0.0)
425 self.assertAlmostEqual(phase(complex(INF, INF)), pi/4)
426 self.assertAlmostEqual(phase(complex(2.3, INF)), pi/2)
427 self.assertAlmostEqual(phase(complex(0.0, INF)), pi/2)
428 self.assertAlmostEqual(phase(complex(-0.0, INF)), pi/2)
429 self.assertAlmostEqual(phase(complex(-2.3, INF)), pi/2)
430 self.assertAlmostEqual(phase(complex(-INF, INF)), 0.75*pi)
431 self.assertAlmostEqual(phase(complex(-INF, 2.3)), pi)
432 self.assertAlmostEqual(phase(complex(-INF, 0.0)), pi)
436 self.assertTrue(math.isnan(phase(z)))