Quinternions
Attributed to Russell Walsmith
Written by Paul Bourke
August 2005
The images shown here are based upon quinternion arithmetic and
are created in a similar way to the Mandelbrot set. That is,
a function is iterated with some dependency on a position on the complex plane.
The outcome of the series (infinity, zero, or
otherwise) determines the state of that position and ultimately how it is
represented graphically.
Generally the distinction
is made between the series tending to zero (inside the set) and other
behavior (outside the set).
The difference here is the
function being iterated is not in the complex plane but rather in five
dimensions. To determine whether the position in 5D is inside or outside
the set, a test is made whether the magnitude of the series (a 5 dimensional
vector)
tends to zero. The result, as shown in the images on the right is a Mandelbrot
like outline, extruded in 3D space over some limited range. In these image the
first three dimensions are mapped to 3D cartesian coordinates and the last
two dimensions are fixed at one value, a point in the plane of the last two
dimensions.
The series in five dimensions is given by
x_{n+1} = a + x_{0}
y_{n+1} = b + y_{0}
z_{n+1} = c + z_{0}
u_{n+1} = d + u_{0}
v_{n+1} = e + v_{0}
where
a = x_{n}^{2} + 2 (y_{n}v_{n} + z_{n}u_{n})
b = u_{n}^{2} + 2 (x_{n}y_{n} + z_{n}v_{n})
c = y_{n}^{2} + 2 (x_{n}z_{n} + u_{n}v_{n})
d = v_{n}^{2} + 2 (x_{n}u_{n} + y_{n}z_{n})
e = z_{n}^{2} + 2 (x_{n}v_{n} + y_{n}u_{n})
where (x_{0},y_{0},z_{0},u_{0},v_{0})
is the point in question.
C style code to evaluate the quinternion
int Eval(double *q,int nmax)
{
int i,n=0;
double a[5],q1[5] = {0,0,0,0,0};
double zz = 0;
while (zz < 100 && n < nmax) {
a[0] = q1[0]*q1[0]+2*(q1[1]*q1[4]+q1[2]*q1[3]);
a[1] = q1[3]*q1[3]+2*(q1[0]*q1[1]+q1[2]*q1[4]);
a[2] = q1[1]*q1[1]+2*(q1[0]*q1[2]+q1[3]*q1[4]);
a[3] = q1[4]*q1[4]+2*(q1[0]*q1[3]+q1[1]*q1[2]);
a[4] = q1[2]*q1[2]+2*(q1[0]*q1[4]+q1[1]*q1[3]);
zz = 0;
for (i=0;i<<5;i++) {
q1[i] = a[i] + q[i];
zz += q1[i] * q1[i];
}
n++;
}
return(n);
}

