def test_orienters():
    A = CoordSysCartesian('A')
    axis_orienter = AxisOrienter(a, A.k)
    body_orienter = BodyOrienter(a, b, c, '123')
    space_orienter = SpaceOrienter(a, b, c, '123')
    q_orienter = QuaternionOrienter(q1, q2, q3, q4)
    assert (axis_orienter.rotation_matrix(A) == Matrix([[cos(a), sin(a), 0], [(- sin(a)), cos(a), 0], [0, 0, 1]]))
    assert (body_orienter.rotation_matrix() == Matrix([[(cos(b) * cos(c)), (((sin(a) * sin(b)) * cos(c)) + (sin(c) * cos(a))), ((sin(a) * sin(c)) - ((sin(b) * cos(a)) * cos(c)))], [((- sin(c)) * cos(b)), ((((- sin(a)) * sin(b)) * sin(c)) + (cos(a) * cos(c))), ((sin(a) * cos(c)) + ((sin(b) * sin(c)) * cos(a)))], [sin(b), ((- sin(a)) * cos(b)), (cos(a) * cos(b))]]))
    assert (space_orienter.rotation_matrix() == Matrix([[(cos(b) * cos(c)), (sin(c) * cos(b)), (- sin(b))], [(((sin(a) * sin(b)) * cos(c)) - (sin(c) * cos(a))), (((sin(a) * sin(b)) * sin(c)) + (cos(a) * cos(c))), (sin(a) * cos(b))], [((sin(a) * sin(c)) + ((sin(b) * cos(a)) * cos(c))), (((- sin(a)) * cos(c)) + ((sin(b) * sin(c)) * cos(a))), (cos(a) * cos(b))]]))
    assert (q_orienter.rotation_matrix() == Matrix([[((((q1 ** 2) + (q2 ** 2)) - (q3 ** 2)) - (q4 ** 2)), (((2 * q1) * q4) + ((2 * q2) * q3)), ((((- 2) * q1) * q3) + ((2 * q2) * q4))], [((((- 2) * q1) * q4) + ((2 * q2) * q3)), ((((q1 ** 2) - (q2 ** 2)) + (q3 ** 2)) - (q4 ** 2)), (((2 * q1) * q2) + ((2 * q3) * q4))], [(((2 * q1) * q3) + ((2 * q2) * q4)), ((((- 2) * q1) * q2) + ((2 * q3) * q4)), ((((q1 ** 2) - (q2 ** 2)) - (q3 ** 2)) + (q4 ** 2))]]))
def test_orienters():
    A = CoordSysCartesian('A')
    axis_orienter = AxisOrienter(a, A.k)
    body_orienter = BodyOrienter(a, b, c, '123')
    space_orienter = SpaceOrienter(a, b, c, '123')
    q_orienter = QuaternionOrienter(q1, q2, q3, q4)
    assert (axis_orienter.rotation_matrix(A) == Matrix([[cos(a), sin(a), 0], [(- sin(a)), cos(a), 0], [0, 0, 1]]))
    assert (body_orienter.rotation_matrix() == Matrix([[(cos(b) * cos(c)), (((sin(a) * sin(b)) * cos(c)) + (sin(c) * cos(a))), ((sin(a) * sin(c)) - ((sin(b) * cos(a)) * cos(c)))], [((- sin(c)) * cos(b)), ((((- sin(a)) * sin(b)) * sin(c)) + (cos(a) * cos(c))), ((sin(a) * cos(c)) + ((sin(b) * sin(c)) * cos(a)))], [sin(b), ((- sin(a)) * cos(b)), (cos(a) * cos(b))]]))
    assert (space_orienter.rotation_matrix() == Matrix([[(cos(b) * cos(c)), (sin(c) * cos(b)), (- sin(b))], [(((sin(a) * sin(b)) * cos(c)) - (sin(c) * cos(a))), (((sin(a) * sin(b)) * sin(c)) + (cos(a) * cos(c))), (sin(a) * cos(b))], [((sin(a) * sin(c)) + ((sin(b) * cos(a)) * cos(c))), (((- sin(a)) * cos(c)) + ((sin(b) * sin(c)) * cos(a))), (cos(a) * cos(b))]]))
    assert (q_orienter.rotation_matrix() == Matrix([[((((q1 ** 2) + (q2 ** 2)) - (q3 ** 2)) - (q4 ** 2)), (((2 * q1) * q4) + ((2 * q2) * q3)), ((((- 2) * q1) * q3) + ((2 * q2) * q4))], [((((- 2) * q1) * q4) + ((2 * q2) * q3)), ((((q1 ** 2) - (q2 ** 2)) + (q3 ** 2)) - (q4 ** 2)), (((2 * q1) * q2) + ((2 * q3) * q4))], [(((2 * q1) * q3) + ((2 * q2) * q4)), ((((- 2) * q1) * q2) + ((2 * q3) * q4)), ((((q1 ** 2) - (q2 ** 2)) - (q3 ** 2)) + (q4 ** 2))]]))