logo back up home forward   further reading more topics »

Maths - 3D Clifford Algebra - Arithmetic

There is a 3D mulivector calculator at the end of this page.

The arithmatic on this page asumes the operands are a general case of a 3D multivector:

a.e + a.e1 e1 + a.e2 e2 + a.e3 e3 + a.e12 e1^ e2 + a.e31 e3^ e1 + a.e23 e2^ e3 + a.e123 e1^ e2^ e3

and a second multivector:

b.e + b.e1 e1 + b.e2 e2 + b.e3 e3 + b.e12 e1^ e2 + b.e31 e3^ e1 + b.e23 e2^ e3 + b.e123 e1^ e2^ e3

Adding multi vectors numbers

Just add each component independently as follows:

e = a.e + b.e
e1 = a.e1 + b.e1
e2 = a.e2 + b.e2
e3 = a.e3 + b.e3
e12 = a.e12 + b.e12
e31 = a.e31 + b.e31
e23 = a.e23 + b.e23
e123 = a.e123 + b.e123

This operation will be coded in the multi3d class (see this class here).

When adding blades of different grade then we cant reduce it further and we leave the + in the number.

For example:

3 + 4 e1 + 5 e12

added to

5 + 4 e2 + 3 e12

gives

8 + 4 e1 + 4 e2 + 8 e12

Subtracting multi vectors numbers

Just subtract each component independently as follows:

e = a.e - b.e
ex = a.ex - b.ex
ey = a.ey - b.ey
ez = a.ez - b.ez
exy = a.exy - b.exy
ezx = a.ezx - b.ezx
eyz = a.eyz - b.eyz
exyz = a.exyz - b.exyz

This operation will be coded in the multi3d class (see this class here).

Multiplying 3D multivectors numbers (geometric product)

The main type of multiplication, which is described here, is geometric multiplication.

So if we have a general case of a 3D multivector:

a.e + a.e1 e1 + a.e2 e2 + a.e3 e3 + a.e12 e1^ e2 + a.e31 e3^ e1 + a.e23 e2^ e3 + a.e123 e1^ e2^ e3

and a second multivector:

b.e + b.e1 e1 + b.e2 e2 + b.e3 e3 + b.e12 e1^ e2 + b.e31 e3^ e1 + b.e23 e2^ e3 + b.e123 e1^ e2^ e3

Since * is distributive over + we can multiply out the terms:

(a.e + a.e1 e1 + a.e2 e2 + a.e3 e3 + a.e12 e1^ e2 + a.e31 e3^ e1 + a.e23 e2^ e3 + a.e123 e1^ e2^ e3) * (b.e + b.e1 e1 + b.e2 e2 + b.e3 e3 + b.e12 e1^ e2 + b.e31 e3^ e1 + b.e23 e2^ e3 + b.e123 e1^ e2^ e3)

this gives the result:

e = a.e * b.e + a.e1 * b.e1 + a.e2 * b.e2 + a.e3 * b.e3 - a.e12 * b.e12 - a.e31 * b.e31 - a.e23 * b.e23 - a.e123 * b.e123
e1 = a.e * b.e1 + a.e1 * b.e - a.e2 * b.e12 + a.e3 * b.e31 + a.e12 * b.e2 - a.e31 * b.e3 - a.e23 * b.e123 - a.e123 * b.e23
e2 = a.e * b.e2 + a.e1 * b.e12 + a.e2 * b.e - a.e3 * b.e23 - a.e12 * b.e1 - a.e31 * b.e123 + a.e23 * b.e3 - a.e123 * b.e31
e3 = a.e * b.e3 - a.e1 * b.e31 + a.e2 * b.e23 + a.e3 * b.e - a.e12 * b.e123 + a.e31 * b.e1 - a.e23 * b.e2 - a.e123 * b.e12
e12 = a.e * b.e12 + a.e1 * b.e2 - a.e2 * b.e1 + a.e3 * b.e123 + a.e12 * b.e + a.e31 * b.e23 - a.e23 * b.e31 + a.e123 * b.e3
e31 = a.e * b.e31 - a.e1 * b.e3 + a.e2 * b.e123 + a.e3 * b.e1 - a.e12 * b.e23 + a.e31 * b.e + a.e23 * b.e12 + a.e123 * b.e2
e23 = a.e * b.e23 + a.e1 * b.e123 + a.e2 * b.e3 - a.e3 * b.e2 + a.e12 * b.e31 - a.e31 * b.e12 + a.e23 * b.e + a.e123 * b.e1
e123 = a.e * b.e123 + a.e1 * b.e23 + a.e2 * b.e31 + a.e3 * b.e12 + a.e12 * b.e3 + a.e31 * b.e2 + a.e23 * b.e1 + a.e123 * b.e

This is derived from the multipication table:

a*b
b.e b.e1 b.e2 b.e3 b.e12 b.e31 b.e23 b.e123
a.e 1 e1 e2 e3 e12 e31 e23 e123
a.e1 e1 1 e12 -e31 e2 -e3 e123 e23
a.e2 e2 -e12 1 e23 -e1 e123 e3 e31
a.e3 e3 e31 -e23 1 e123 e1 -e2 e12
a.e12 e12 -e2 e1 e123 -1 e23 -e31 -e3
a.e31 e31 e3 e123 -e1 -e23 -1 e12 -e2
a.e23 e23 e123 -e3 e2 e31 -e12 -1 -e1
a.e123 e123 e23 e31 e12 -e3 -e2 -e1 -1

This multipication table is derived on this page.

alternative method

Some programs implement multiplication by using Eddington Basis

Eddington Basis for aMonad
E Number 1 : 0, 0, 0, *0
E Number 2 : 0, 0, 1, *1
E Number 3 : 0, 0, 2, *2
E Number 4 : 0, 0, 3, *3
E Number 5 : 0, 1, 2, *6
E Number 6 : 0, 1, 3, *7
E Number 7 : 0, 2, 3, *11
E Number 8 : 1, 2, 3, *27


Basis products for aMonad
E Number 1 : 1, 2, 3, 4, 5, 6, 7, 8, *0
E Number 2 : 2, 1, 5, 6, 3, 4, 8, 7, *1
E Number 3 : 3, -5, 1, 7, -2, -8, 4, -6, *2
E Number 4 : 4, -6, -7, 1, 8, -2, -3, 5, *3
E Number 5 : 5, -3, 2, 8, -1, -7, 6, -4, *6
E Number 6 : 6, -4, -8, 2, 7, -1, -5, 3, *7
E Number 7 : 7, 8, -4, 3, -6, 5, -1, -2, *11
E Number 8 : 8, 7, -6, 5, -4, 3, -2, -1, *27


Basis products for aMonad
E Number 1 : 1, 2, 3, 4, 5, 6, 7, 8, *0
E Number 2 : 2, -1, 5, 6, -3, -4, 8, -7, *1
E Number 3 : 3, -5, -1, 7, 2, -8, -4, 6, *2
E Number 4 : 4, -6, -7, -1, 8, 2, 3, -5, *3
E Number 5 : 5, 3, -2, 8, -1, 7, -6, -4, *6
E Number 6 : 6, 4, -8, -2, -7, -1, 5, 3, *7
E Number 7 : 7, 8, 4, -3, 6, -5, -1, -2, *11
E Number 8 : 8, -7, 6, -5, -4, 3, -2, 1, *27

Inner and Outer products

trasitions

In addition to the geometric product there are two more types of multiplication used in Geometric Algebra. These extend and generalise the 'dot' and 'cross' products used in 3D vector algebra.

Inner product by a vector reduces the grade of a multivector. It is related to the dot product.

Outer product by a vector increases the grade of a multivector. It is related to the cross product.

Outer product

We want the outer product to be an extension of the vector cross product:

x = Ay * Bz - By * Az
y = Az * Bx - Bz * Ax
z = Ax * By - Bx * Ay

This gives a bivector which is mutually perpendicular to the vectors being multiplied. But how do we extend this so that we can multiply non-vectors? There are different definitions for the outer product so we need to be careful, if you use other websites or books you may find that they use different definitions. Here is the full 3D Outer multiplication table:

a^b
b.e b.e1 b.e2 b.e3 b.e12 b.e31 b.e23 b.e123
a.e e e1 e2 e3 e12 e31 e23 e123
a.e1 e1 0 e12 -e31 0 0 e123 0
a.e2 e2 -e12 0 e23 0 e123 0 0
a.e3 e3 e31 -e23 0 e123 0 0 0
a.e12 e12 0 0 e123 0 0 0 0
a.e31 e31 0 e123 0 0 0 0 0
a.e23 e23 e123 0 0 0 0 0 0
a.e123 e123 0 0 0 0 0 0 0

This is explained here.

Inner product.

We want the outer product to be an extension of the vector dot product:

A • B = Ax * Bx + Ay * By + Az * Bz

This gives a scalar which depends on the angle between the vectors being multiplied, it is zero if the vectors are perpendicular and zero if the vectors are parallel. But how do we extend this so that we can multiply non-vectors? There are different definitions for the inner product so we need to be careful, if you use other websites or books you may find that they use different definitions. Here we will use the 'semi-commutative inner product' which has the following 3D Inner multiplication table:

a•b
b.e b.e1 b.e2 b.e3 b.e12 b.e31 b.e23 b.e123
a.e 0 0 0 0 0 0 0 0
a.e1 0 e 0 0 e2 -e3 0 e23
a.e2 0 0 e 0 -e1 0 e3 e31
a.e3 0 0 0 e 0 e1 -e2 e12
a.e12 0 -e2 e1 0 -e 0 0 -e3
a.e31 0 e3 0 -e1 0 -e 0 -e2
a.e23 0 0 -e3 e2 0 0 -e -e1
a.e123 0 e23 e31 e12 -e3 -e2 -e1 -e

This is explained here.

Division

We don't tend to use the notation for division, since multivector multiplication is not commutative we need to be able to distinguish between [a][b]-1 and [b]-1[a]. So instead of a divide operation we tend to multiply by the inverse.

So the problem is, how to calculate the inverse of a multivector, this is discussed here.

Multivector Calculator

The following calculator allows you to calculate multivector arithmetic. Enter the values into the top two multivectors and then press "+ - or * " to display the result in the bottom multivector:

scalar e    
vector e1 e2 e3
bivector e12 e31 e23
tri-vector e123    
scalar e    
vector e1 e2 e3
bivector e12 e31 e23
tri-vector e123    
=
scalar e    
vector e1 e2 e3
bivector e12 e31 e23
tri-vector e123    

metadata block
see also:

 

Correspondence about this page

Book Shop - Further reading.

Where I can, I have put links to Amazon for books that are relevant to the subject, click on the appropriate country flag to get more details of the book or to buy it from them.

cover Clifford Algebra to Geometric Calculus: A Unified Language for Mathematics and Physics (Fundamental Theories of Physics). This book is intended for mathematicians and physicists rather than programmers, it is very theoretical. It covers the algebra and calculus of multivectors of any dimension and is not specific to 3D modelling.

cover New Foundations for Classical Mechanics (Fundamental Theories of Physics). This is very good on the geometric interpretation of this algebra. It has lots of insights into the mechanics of solid bodies. I still cant work out if the position, velocity, etc. of solid bodies can be represented by a 3D multivector or if 4 or 5D multivectors are required to represent translation and rotation.

Commercial Software Shop

Where I can, I have put links to Amazon for commercial software, not directly related to the software project, but related to the subject being discussed, click on the appropriate country flag to get more details of the software or to buy it from them.

cover Mathmatica

Can you help?

Please send me any improvements to here. I would appreciate ideas to make the pages more useful including error correction, ideas for new pages, improvements to wording. It helps if you quote the full URL of the page.

 

Terminology and Notation

Specific to this page here:

 

program

I am working on a project which uses these principles, if you would like to help me with this you are welcome to join in, here:

http://sourceforge.net/projects/mjbworld/

This site may have errors. Don't use for critical systems.

Copyright (c) 1998-2008 Martin John Baker - All rights reserved - privacy policy.