Article 5K9AJ Quaternion product as a matrix product

Quaternion product as a matrix product

by
John
from John D. Cook on (#5K9AJ)

Pick a quaternion

p = p0 + p1i + p2j + p3k

and consider the function that acts on quaternions by multiplying them on the left by p.

If we think of q as a vector in R4 then this is a linear function of q, and so it can be represented by multiplication by a 4 * 4 matrix Mp.

It turns out

Mp.svg

How might you remember or derive this matrix? Consider the matrix on the left below. It's easier to see the pattern here than in Mp.

Mpp.svg

You can derive Mp from this matrix.

Let's look at the second row, for example. The second row of Mp, when multiplied by q as a column vector, produces the i component of the product.

How do you get an i term in the product? By multiplying the i component of p by the real component of q, or by multiplying the real component of p times the i component of p, or by multiplying the i/ j component of p by the j component of q, or by multiplying the i/k component of p by the k component of q.

The other rows follow the same pattern. To get the x component of the product, you add up the products of the x/y term of p and the y term of q. Here x and y range over

{1, i, j, k}.

To get Mp from the matrix on the right, replace 1 with the real component of p, replace i with the i component of p, etc.

As a final note, notice that the off-diagonal elements of Mp are anti-symmetric:

mij = -mji

unless i = j.

The post Quaternion product as a matrix product first appeared on John D. Cook.sibZ-iPB83I
External Content
Source RSS or Atom Feed
Feed Location http://feeds.feedburner.com/TheEndeavour?format=xml
Feed Title John D. Cook
Feed Link https://www.johndcook.com/blog
Reply 0 comments