I am really new to mathematica and the syntax sometimes is a bit hard for me. I come from Matlab environment. I think this question is really easy for the most of you.
I am trying to use quaternions in Mathematica and I wrote the following code:
ClearAll["Global`*"] << Quaternions` q1 = Quaternion[q_t, q_x, q_y, q_z]; q2 = Conjugate[q1]; A = Quaternion[0, A_x, A_y, A_z]; totQuat1 = Simplify[q1 ** A ** q2]
Everything seems right to me and I get:
Quaternion[0,A_x (q_t^2+q_x^2-q_y^2-q_z^2)+2 (A_y (q_x q_y-q_t q_z)+A_z (q_t q_y+q_x q_z)),A_y (q_t^2-q_x^2+q_y^2-q_z^2)+2 (A_x (q_x q_y+q_t q_z)+A_z (-q_t q_x+q_y q_z)),A_z (q_t^2-q_x^2-q_y^2+q_z^2)+2 (A_x (-q_t q_y+q_x q_z)+A_y (q_t q_x+q_y q_z))]
But now I would like to take the second element of the quaternion and set A_x to 0.
I am trying to do:
But what I get is the second component of the quaternion and the A_x is not set to 0.
A_x (q_t^2 + q_x^2 - q_y^2 - q_z^2) + 2 (A_y (q_x q_y - q_t q_z) + A_z (q_t q_y + q_x q_z))
How can I do that?
Thanks a lot.