If you are multiplying P x Q where P and Q are two quaternions create a grid as shown below.
Write the first quaternion of the multiplication in a column on the left side of the grid and then write the second quaternion in a row at the top of the grid.
At the intersection of each row and column, write the multiplication of the two parts of the quaternions that are at the start of a row and the top of a column remembering to write the P part first.
Whenever a quaternion part is zero write zero in the entire row or column since zero times anything is zero.
Now replace the letter times letter multiplications at each intersection.
If the letters are the same, replace them with –1
If the letters are different, replace them with a single letter according to the following rules.
- i x j = k
- i x k = –j
- j x i = –k
- j x k = i
- k x i = j
- k x j = –i
Find the first letter of the multiplication in the circle and then move in the circle to the second letter of the multiplication.
The result of the multiplication is the next letter in the circle in the same direction you moved.
If you moved in a counter-clockwise direction the result is positive.
If you moved in a clockwise direction, change the sign of the third letter to negative.
If you are familiar with the vector cross product you can use another trick to remember the rules.
Draw a right handed coordinate system with the axes marked i, j and k as shown below.
Then cross the first letter’s axis into the second letter’s axis with your right hand.
The letter of the axis direction your thumb points in is the letter the multiplication equals.
If your thumb points in the negative axis direction the sign of the letter is negative.
Once you have replaced all the letter x letter multiplications, add up all the numbers multiplied by i to get the i part of the quaternion.
Add up all the j parts to get the j part.
Add up all the k parts to the k part.
Add up all the real number parts to get the real number part.
Here is a worked example.
First calculate your quaternions and set up the grid.
Next mark the columns and rows with zero if any part of the either quaternion is zero.
Next write the multiplication of the parts at the row/column intersections in the order P part first.
Next resolve the multiplications at the row/column intersections by multiplying the numbers together and then replacing the letter multiplications according to the rules.
Here only i x j was replaced with k.
Add up all the multiplications that include i to get the new i part of the quaternion.
Add up all the multiplications that include j to get the new j part of the quaternion.
Add up all the multiplications that include k to get the new k part of the quaternion.
And finally add up all the numbers to get the real part of the quaternion and you have the resultant quaternion.
No comments:
Post a Comment