quaternion product correction
This correction is way too long in coming, I hope it didn't mess anyone up. I have been corresponding with Wes Loewer, Fractint's arbitrary precision author. He is teaching math and physics in Nairobi, Kenya at Rosslyn Academy (http://www.rosslynacademy.com) which is an American curriculum K-12 school. We passed along this correction, which I have verified. In any case, it turns out that the formula for the quaternion product in both the Fractint docs and Fractal Creations 2nd Edition is wrong. The current (wrong) formula for quaternion (x,y,z,w) is: q1q2 = 1(x1x2 - y1y2 - z1z2 - w1w2) + i(y1x2 + x1y2 + w1z2 - z1w2) + j(z1x2 - w1y2 + x1z2 + y1w2) + k(w1x2 + z1y2 - y1z2 + x1w2) The correct formula is: Then q1q2 = 1(x1x2 - y1y2 - z1z2 - w1w2) + i(y1x2 + x1y2 - w1z2 + z1w2) + j(z1x2 + w1y2 + x1z2 - y1w2) + k(w1x2 - z1y2 + y1z2 + x1w2) Fortunately, this multiplication function isn't coded up in fractint anywhere, and as far as I know, none of the quaternion fractals is wrong. (At this point if they WERE wrong I'd leave them as is for backwards compatibility.) Also fortunately, the hypercomplex formulas in the documentation and in the code appear to be right. Clyde Davenport's book on hypercomplex numbers is now online. This was my main source on hypercomplex numbers. The link is: http://home.usit.net/~cmdaven/cmdaven1.htm A useful link that includes formulations of some analytic functions of the quaternions that would probably be suitable for fractal implementations (maybe even in fractint) is: http://world.std.com/~sweetser/quaternions/intro/tools/tools.html Tim
More concerning my correspondence with Wes Loewer. One of the things that attracted me to Hypercomplex numbers was that there is a general way to calculate a function on the hypercomplex numbers from the analogous complex function. Wes showed me how to do the same thing with quaternions. It isn't quite as elegant, but it's not hard. This means I could add fractal types quaternion and quaternionj that are exact analogues (with equal generality) of the hypercomplex and hypercomplexj types. (These are general because they use a function variable that can be set to a variety of analytic functions.) There are some quaternion types already in fractint but they are less general. I guess I should check out POVray also for the same generalization possibility. I'm enjoying the possibility of this project since I haven't contributed any code to fractint for a long time. Jonathan has been holding down the fort by himself. Tim
Tim Wegner wrote:
The correct formula is:
Then q1q2 = 1(x1x2 - y1y2 - z1z2 - w1w2) + i(y1x2 + x1y2 - w1z2 + z1w2) + j(z1x2 + w1y2 + x1z2 - y1w2) + k(w1x2 - z1y2 + y1z2 + x1w2)
Provided one knows the formula for complex multiplication by heart (and which fractal geek doesn't :^)), then it's easier to put the four elements of a quaternion into two complex variables and go from there: q1 = (a1,b1), where a1 = x1 + i*y1 and b1 = z1 + i*w1 q2 = (a2,b2), where a2 = x2 + i*y2 and b2 = z2 + i*w2 q3 = q1*q2 --> a3 = a1*a2 - b1*conj(b2) b3 = a1*b2 + b1*conj(a2) Except for the two conjugations this multiplication has an identical look to the one for complex numbers (the latter done in real numbers, of course). And that form is very convenient when using quaternions in Fractint's formula parser... Regards, Gerald
Gerald wrote:
Provided one knows the formula for complex multiplication by heart (and which fractal geek doesn't :^)), then it's easier to put the four elements of a quaternion into two complex variables and go from there:
q1 = (a1,b1), where a1 = x1 + i*y1 and b1 = z1 + i*w1 q2 = (a2,b2), where a2 = x2 + i*y2 and b2 = z2 + i*w2
q3 = q1*q2 --> a3 = a1*a2 - b1*conj(b2) b3 = a1*b2 + b1*conj(a2)
Except for the two conjugations this multiplication has an identical look to the one for complex numbers (the latter done in real numbers, of course).
I just searched this list for "quaternion" in my list archives and came up with quite a bit including Jim Muth's lament about lack of degrees of freedom. I think I can remedy that. It turns out that there really is something more elegant about the hypercomplex numbers. If you represent quaternions and hypercomplex numbers as 2x2 matrices of complex numbers, you can generalize functions by making use of a theorem (I need to find it - if anyone can help let me know) that a generalized function applied to a matrix can be calculated by applying the less generalized version of the function to the the diagonals of the matrix after it is diagonalized. You diagonalize it by pre and pos multiplying by a matrix formed from the eigenvectors. The matrix of eigenvectors is constant for hypercomplex numbers, but is dependent on the value for quaternions. The method still works for quaternions but is much messier. I'll post a more detailed explanation after I'm through sorting this out with Wes Loewer. Tim
participants (2)
-
Gerald K. Dobiasovsky -
Tim Wegner