Real-time Rendering of Quaternion Julia Sets

Julia sets are some of the most common examples of the extreme complexity which can arise from very simepl mathematical expressions. The Julia set for some complex number c is the set of all complex values z where z_n+1 = z_n + c converges to a finite value. Quaternion Julia sets are a straightforward extension of complex Julia sets into four-dimensional quaternion space, however the two additional dimensions complicate the task of rendering quaternion Julia sets. Since we lack the ability to directly visualize a four-dimensional object, we must find a way to map dimensions into three or less. There are two approaches we can take: either render just a single 3D slice of quaternion space, or project quaternion space into three dimensions to see the 3D shadow of the Julia set. On modern hardware, testing the convergence of z for every pixel in the image rectangle can be produce reasonably detailed renderings of complex Julia sets at interactive rates. However, this method is currently two slow for any more than two dimensions. A shortcut is to just compute and render the boundary points of the Julia by utilizing inverse iteration. The terms in the sequence: z_n+1 = sqrt(z_n - c) converge to the boundary of the complex Julia set for c. There are two values for the square root of any complex number, one the negative of the other. If we randomly choose either the positive or negative root and plot z_n at every step, we can get a picture of the approximate boundary of the Julia set. This technique works almost exactly the same in quaternion space except for one minor complication--the square root of a quaternion has two values unless the real part is negative and the three imaginary parts are all zero in which case there are infinitely many values for the square root. In practice, we just get around this by choosing the two values for sqrt(q) that lie on the i axis. Iterating q_n+1 = sqrt(q_n - c) gives a set of quaternions which To get around this, we can use inverse iteration to compute the approximate boundary points of the Julia set boundary points of the Julia set