Esempio n. 1
0
    def test_tangent(self):
        q = Quadric([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, -1]])

        assert q.contains(Point(1, 0, 0))
        assert q.tangent(at=Point(1, 0, 0)) == Plane(Point(1, 0, 0),
                                                     Point(1, 0, 1),
                                                     Point(1, 1, 0))
Esempio n. 2
0
    def test_components(self):
        l = Line(1, 2, 3)
        m = Line(4, 5, 6)
        g = Line(3, 2, 1)
        h = Line(6, 5, 4)

        q = QuadricCollection([Conic.from_lines(l, m), Conic.from_lines(g, h)])
        assert q.components == [LineCollection([m, g]), LineCollection([l, h])]

        e = Plane(1, 2, 3, 4)
        f = Plane(4, 3, 2, 1)
        g = Plane(5, 6, 7, 8)
        h = Plane(8, 7, 6, 5)

        q = QuadricCollection([Quadric.from_planes(e, f), Quadric.from_planes(g, h)])
        assert q.components == [PlaneCollection([e, g]), PlaneCollection([f, h])]
Esempio n. 3
0
    def test_components(self):
        e = Plane(1, 2, 3, 4)
        f = Plane(4, 3, 2, 1)

        q = Quadric.from_planes(e, f)
        assert q.components == [e, f]