Lines Matching refs:pi
5 from cmath import phase, polar, rect, pi
117 self.assertAlmostEqual(cmath.pi, pi_expected, places=9,
118 msg="cmath.pi is {}; should be {}".format(cmath.pi, pi_expected))
361 check(-1, (1., pi))
362 check(1j, (1., pi / 2))
363 check(-3j, (3., -pi / 2))
366 check(complex(-inf, 0), (inf, pi))
367 check(complex(3, inf), (inf, pi / 2))
368 check(complex(5, -inf), (inf, -pi / 2))
369 check(complex(inf, inf), (inf, pi / 4))
370 check(complex(inf, -inf), (inf, -pi / 4))
371 check(complex(-inf, inf), (inf, 3 * pi / 4))
372 check(complex(-inf, -inf), (inf, -3 * pi / 4))
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)
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)
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)
474 self.assertCEqual(rect(1, -pi), (-1., 0))
475 self.assertCEqual(rect(1, pi/2), (0, 1.))
476 self.assertCEqual(rect(1, -pi/2), (0, -1.))