15.11.2014 Views

Chapter 4: Programming in Matlab - College of the Redwoods

Chapter 4: Programming in Matlab - College of the Redwoods

Chapter 4: Programming in Matlab - College of the Redwoods

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

396 <strong>Chapter</strong> 4 <strong>Programm<strong>in</strong>g</strong> <strong>in</strong> <strong>Matlab</strong><br />

ij = k = −ji, jk = i = −kj, ki = j = −ik (4.11)<br />

Students <strong>of</strong> vector calculus will recognize <strong>the</strong> familiar relationships amongst i, j,<br />

and k, if <strong>the</strong>y th<strong>in</strong>k <strong>of</strong> i, j, and k as unit vectors along <strong>the</strong> x, y, and z axes <strong>in</strong> <strong>the</strong><br />

usual 3-space orientation used <strong>in</strong> vector calculus.<br />

Of course, <strong>the</strong> relationships <strong>in</strong> (4.11) demonstrate that multiplication <strong>of</strong> <strong>the</strong><br />

quaternions is not commutative. Chang<strong>in</strong>g <strong>the</strong> order <strong>of</strong> <strong>the</strong> factors changes <strong>the</strong><br />

product. In general, if u and v are quaternions, it is not <strong>the</strong> case that uv equals<br />

vu.<br />

Sir William was able to demonstrate that multiplication was an associative operation<br />

((uv)w = u(vw)) and that multiplication is distributive with respect to<br />

addition (u(v + w) = uv + uw). With associativity and <strong>the</strong> distributive law <strong>in</strong><br />

hand, a straightforward (albeit messy) calculation shows that <strong>the</strong> product <strong>of</strong> <strong>the</strong><br />

quaternions u = u 1 + u 2 i + u 3 j + u 4 k and v = v 1 + v 2 i + v 3 j + v 4 k is<br />

uv = (u 1 v 1 − u 2 v 2 − u 3 v 3 − u 4 v 4 ) + (u 1 v 2 + u 2 v 1 + u 3 v 4 − u 4 v 3 )i<br />

+ (u 1 v 3 + u 3 v 1 + u 4 v 2 − u 2 v 4 )j + (u 1 v 4 + u 4 v 1 + u 2 v 3 − u 3 v 2 )k.<br />

(4.12)<br />

When you studied <strong>the</strong> complex numbers, before mak<strong>in</strong>g <strong>the</strong> def<strong>in</strong>ition <strong>of</strong> division,<br />

you paused to develop <strong>the</strong> complex conjugate. In a similar manner, if u = u 1 +<br />

u 2 i + u 3 j + u 4 k, <strong>the</strong>n <strong>the</strong> conjugate <strong>of</strong> this quaternion is <strong>the</strong> quaternion<br />

u = u 1 + u 2 i + u 3 j + u 4 k = u 1 − u 2 i − u 3 j − u 4 k. (4.13)<br />

Note that <strong>the</strong> conjugate <strong>of</strong> a quaternion if very similar to <strong>the</strong> conjugate <strong>of</strong> a<br />

complex number. That is, if z is <strong>the</strong> complex number z = a + bi, <strong>the</strong>n <strong>the</strong><br />

conjugate <strong>of</strong> z is z = a − bi. Geometrically, <strong>the</strong> conjugate <strong>of</strong> <strong>the</strong> complex number<br />

z is <strong>the</strong> reflection <strong>of</strong> z across <strong>the</strong> real axis, as shown <strong>in</strong> Figure 4.11.<br />

Imag<br />

z = a + bi<br />

Real<br />

z = a − bi<br />

Figure 4.11. The conjugate is a reflection<br />

across <strong>the</strong> real axis.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!