Associated Topics || Dr. Math Home || Search Dr. Math

### Quaternary Numbers

```
Date: 28 Jun 1995 10:05:49 -0400
From: Jonathan Rose
Subject: Quaternery Numbers

How do quaternary numbers work?  As I understand it, it's
q = r + a.i + b.j + c.k where r is real and i^2 = j^2 = k^2 = -1

but what happens when you start multiplying and dividing i, j and k?

does i x j = k or -k?
what is i / j ?

Presumably the modulus | q | = SQR( r^2 + a^2 + b^2 + c^2)

Please tell me all!  I want to render 4d julia sets!
```

```
Date: 28 Jun 1995 16:16:44 -0400
From: Dr. Ken
Subject: Re: Quaternery Numbers

Hello there!

Jonathan Rose's message:

How do quaternary numbers work?  As I understand it its
q = r + a.i + b.j + c.k where r is real and i^2 = j^2 = k^2 = -1

Yes, you're 100% right so far.

but what happens when you start multiplying and dividing
i, j and k?

does i x j = k or -k?

Well, i x j (I'll just write it as ij from now on) equals k, but ji = -k.
You see, the quaternions aren't a commutative system.  Perhaps you

Here's the best way I know of to remember the multiplication facts.
Put the three elements in a circle like this:

i

k     j

Kind of looks like a triangle when there are only three of them, huh.
Then you go around the circle to figure out the multiplication facts.  For
instance, you know that ij is either k or -k, and to find out which one it
is, you see whether you go around clockwise or counterclockwise in the
circle to get from i to j.  Clockwise is positive, counterclockwise is
negative.  Alternatvely, you could write ijkijkijkijkijk...., and if you see
your pattern in the sequence forwards, like jk, ij, or ki, then the product
will be positive.  If it's in the sequence backwards, then the product is
negative.

I guess the short answer, though, is this:

ij = k       ji = -k
jk = i       kj = -i
ki = j       ik = -j.

what is i / j ?

Well, i/j means the same thing as "i times the inverse of j."  So we need to
find out the inverse of j.  That's just what you multiply j by to get 1,
right?  Since j*j = -1, j*(-j) = 1.  So i/j = i*(-j) = -(i*j) = -k.  The
same thing holds in the similar cases.

presmably the modulus | q | = SQR( r^2 + a^2 + b^2 + c^2)

Yes, that's right.

please tell me all!  I want to render 4d julia sets!

Wow, sounds fun!  We're working on a 4D project
here of our own.  Good luck!

-K
```
Associated Topics:
College Modern Algebra

Search the Dr. Math Library:

 Find items containing (put spaces between keywords):   Click only once for faster results: [ Choose "whole words" when searching for a word like age.] all keywords, in any order at least one, that exact phrase parts of words whole words

Submit your own question to Dr. Math
Math Forum Home || Math Library || Quick Reference || Math Forum Search