Exemplo n.º 1
0
    def test_create_model_vertical_through_x_equal_5(self):
        pass
        helper1=RansacLineHelper()
        lst=list()
        lst.append(Point(5,0))
        lst.append(Point(5,1))
        lst.append(Point(5,2))
        model=helper1.create_model(lst)
        expected_xintercept=5
        actual_xintercept=-model.C/model.A
        self.assertAlmostEqual(actual_xintercept,expected_xintercept)

        self.assertAlmostEqual(model.B,0)
Exemplo n.º 2
0
 def test_create_model_horizontal_through_y_equal_5(self):
     pass
     helper1=RansacLineHelper()
     lst=list()
     lst.append(Point(0,5))
     lst.append(Point(1,5))
     lst.append(Point(2,5))
     model=helper1.create_model(lst)
     #y=5
     #0x+1y-5=0
     expected_slope=0.0
     actual_slope=-model.A/model.B
     actual_yintercept=-model.C/model.B
     expected_yintercept=5
     self.assertAlmostEqual(actual_slope,expected_slope)
     self.assertAlmostEqual(actual_yintercept,expected_yintercept)
Exemplo n.º 3
0
 def test_create_model_45_degrees_through_origin(self):
     pass
     helper1=RansacLineHelper()
     lst=list()
     lst.append(Point(0,0))
     lst.append(Point(1,1))
     lst.append(Point(2,2))
     model=helper1.create_model(lst)
     #
     #y=x
     #-x+y+0=0
     expected_slope=1.0
     actual_slope=-model.A/model.B
     actual_yintercept=-model.C/model.B
     expected_yintercept=0
     self.assertAlmostEqual(actual_slope,expected_slope)
     self.assertAlmostEqual(actual_yintercept,expected_yintercept)