MCPcopy Index your code
hub / github.com/OmkarPathak/pygorithm / test_from_regular_center

Method test_from_regular_center

tests/test_geometry.py:673–690  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

671 self.assertAlmostEqual(square.points[i].y, square2.points[i].y)
672
673 def test_from_regular_center(self):
674 for i in range(3, 13):
675 _poly = polygon2.Polygon2.from_regular(i, 1)
676
677 foundx0 = False
678 foundy0 = False
679 for p in _poly.points:
680 if math.isclose(p.x, 0, abs_tol=1e-07):
681 foundx0 = True
682 if foundy0:
683 break
684 if math.isclose(p.y, 0, abs_tol=1e-07):
685 foundy0 = True
686 if foundx0:
687 break
688 helpmsg = "\ni={}\nfoundx0={}, foundy0={}, center={}\nrepr={}\n\nstr={}".format(i, foundx0, foundy0, _poly.center, repr(_poly), str(_poly))
689 self.assertTrue(foundx0, msg=helpmsg)
690 self.assertTrue(foundy0, msg=helpmsg)
691
692
693 def test_from_rotated(self):

Callers

nothing calls this directly

Calls 1

from_regularMethod · 0.80

Tested by

no test coverage detected