Esempio n. 1
0
    def test_from_crossratio(self):
        a = Point(0, 1)
        b = Point(0, -1)
        c = Point(1.5, 0.5)
        d = Point(1.5, -0.5)
        e = Point(-1.5, 0.5)

        conic1 = Conic.from_points(a, b, c, d, e)
        cr = crossratio(a, b, c, d, e)
        conic2 = Conic.from_crossratio(cr, a, b, c, d)

        assert conic1 == conic2
Esempio n. 2
0
    def test_from_points(self):
        a = Point(0, 1)
        b = Point(0, -1)
        c = Point(1.5, 0.5)
        d = Point(1.5, -0.5)
        e = Point(-1.5, 0.5)

        conic = Conic.from_points(a, b, c, d, e)

        assert conic.contains(a)
        assert conic.contains(b)
        assert conic.contains(c)
        assert conic.contains(d)
        assert conic.contains(e)
Esempio n. 3
0
    def test_from_points(self):
        a = Point(-1, 0)
        b = Point(0, 3)
        c = Point(1, 2)
        d = Point(2, 1)
        e = Point(0, -1)

        conic = Conic.from_points(a, b, c, d, e)

        assert conic.contains(a)
        assert conic.contains(b)
        assert conic.contains(c)
        assert conic.contains(d)
        assert conic.contains(e)