Exemplo n.º 1
0
    def test_conjugate_and_multiplication(self):
        q1 = Quaternion(1, 0, 0, 2)
        q2 = Quaternion(3, -1, 4, 3)

        expected = Quaternion(35, 0, 0, 0)

        assert (q1*q2).conjugate() == q2.conjugate() * q1.conjugate()
        assert expected == q2.conjugate()*q2
Exemplo n.º 2
0
    def test_conjugate_and_multiplication(self):
        q1 = Quaternion(1, 0, 0, 2)
        q2 = Quaternion(3, -1, 4, 3)

        expected = Quaternion(35, 0, 0, 0)

        assert (q1 * q2).conjugate() == q2.conjugate() * q1.conjugate()
        assert expected == q2.conjugate() * q2
Exemplo n.º 3
0
    def test_conjugate(self):
        q1 = Quaternion(1, 3, 4, 3)
        q2 = Quaternion(1, -1, -1, 3)

        expected1 = Quaternion(1, -3, -4, -3)
        expected2 = Quaternion(1, 1, 1, -3)

        assert expected1 == q1.conjugate()
        assert expected2 == q2.conjugate()
Exemplo n.º 4
0
    def test_conjugate(self):
        q1 = Quaternion(1, 3, 4, 3)
        q2 = Quaternion(1, -1, -1, 3)

        expected1 = Quaternion(1, -3, -4, -3)
        expected2 = Quaternion(1, 1, 1, -3)

        assert expected1 == q1.conjugate()
        assert expected2 == q2.conjugate()