Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Birla Institute of Technology and Science Pilani

ME/MF F342 Computer Aided Design, II Sem 2019-20


Tutorial 1
17th Jan, 2020 Marks: 20

Name ID Section

1. If q1 = quaternion(1, 2, 3, 4) and q2 = quaternion(0, 1, 2, 3), determine the following: (i) q1 + q2 (ii)


q1 q2 (iii) q2 q1 (iv) q1 /q2
2. (a) Rotate point (0,1,0) about the axis vector (1, 1, 1) by an angle 90◦ using the Quaternions.
(b) Find the rotations about x, y, and z-axis which can achieve the above rotation.

Solution:
(1)If q1 = (a, b, c, d) we can write q1 = a + ~u, where ~u = [b c d] and q2 = (e, f, g, h) = e + ~v, where
~v = [ f g h].
The following formulas are helpful,

q1 + q2 = (a + e + ~u + ~v) = (a + e, b + f, c + g, d + h)
q1 q2 = ae − ~u · ~v + a~v + e~u + ~u × ~v
e − ~v
2 = 2
q−1
a + b2 + c2 + d2
q1 /q2 = q1 q−1
2

Answers: i: (1, 3, 5, 7)
ii: (-20,2,0,4)
iii: (-20,0,4,2)
iv: (1.4286,-0.1428,0,-0.2857)

(2a) Rotated point can be found using the following equation. P~0 = en̂θ/2 Pe~ −n̂θ/2
Let q = en̂θ/2 = cos(θ/2) + n̂ sin(θ/2) = cos(θ/2) + n x sin(θ/2)i + ny sin(θ/2)j + nz sin(θ/2)k
Substituting θ = 90◦ and n̂ = √13 [111]

q = √16 ( 3, 1, 1, 1)
√ √
P~0 = ( √16 [ 3, 1, 1, 1])[0, 0, 1, 0]( √16 [ 3, −1, −1, −1])
√ √
= 61 (−1, −1, 3, 1)( 3, 1, 1, 1)
√ √
= 31 (0, 1 − 3, 1, 1 + 3)

(2b) Step 1: Rotate about z-axis by an angle −45◦


Step 2: Rotate about y-axis by an angle − cos−1 (1/3)
Step 3: Rotate about z-axis by an angle 90◦
Step 4: Rotate about y-axis by an angle cos−1 (1/3)
Step 5: Rotate about z-axis by an angle 45◦

You might also like