コード例 #1
0
 def test_max_point_arc_wraparound(self):
     """max_point() of an arc that traces through 0 degrees"""
     arc = Arc(2, 3, 1.75, 0.25, 5)
     self.assertEqual(arc.max_point().x, 5 + 2)
     self.assertEqual(arc.max_point().y, int(round(sin(0.25 * pi) * 5 + 3)))
コード例 #2
0
 def test_min_point_arc(self):
     """min_point() of an arc tracing top-left quarter"""
     arc = Arc(2, 3, 1, 1.5, 5)
     self.assertEqual(arc.min_point().x, -3)
     self.assertEqual(arc.min_point().y, -2)
コード例 #3
0
 def test_max_point_arc(self):
     """max_point() of an arc tracing bottom-right quarter"""
     arc = Arc(2, 3, 0, 0.5, 5)
     self.assertEqual(arc.max_point().x, 7)
     self.assertEqual(arc.max_point().y, 8)
コード例 #4
0
 def test_max_point_arc_is_circle(self):
     '''max_point() when an arc actually traces out a full circle'''
     arc = Arc(2, 3, 0, 2, 5)
     self.assertEqual(arc.max_point().x, 7)
     self.assertEqual(arc.max_point().y, 8)