Exemplo n.º 1
0
 def test_slope_negative(self):
     s1 = IntegerSegment(IntegerPoint(0, 0), IntegerPoint(2, -1))
     self.assertEqual(s1.slope(), -0.5)
Exemplo n.º 2
0
 def test_slope_zero(self):
     s1 = IntegerSegment(IntegerPoint(0, 0), IntegerPoint(1, 0))
     self.assertEqual(s1.slope(), 0)
Exemplo n.º 3
0
 def test_slope_positive(self):
     s1 = IntegerSegment(IntegerPoint(0, 0), IntegerPoint(2, 1))
     self.assertEqual(s1.slope(), 0.5)
Exemplo n.º 4
0
 def test_slope_inf(self):
     s1 = IntegerSegment(IntegerPoint(0, 0), IntegerPoint(0, 1))
     self.assertEqual(s1.slope(), float("inf"))