This is a split from this
THREAD.
Okay, let me repeat myself: I know pretty much nothing about fractals. I'm very quickly tossing this together because I'm on vacation at the end of the week and rather throw out something potentially with mistakes and without any deep thought because...well I don't mind proving I'm an awesome dude. I'm not claiming that any holy grail is contained within quaternions, but from what I've seen...it really seems like they should be revisited. Oh yeah, I've a thick skin so feel free to mock me if you should feel so inclined. Esp. if all of this is old hat and dead ends.
Quaternions were quickly marginalized for a number of reasons. The first being that Hamiltion and Tait were mostly interested in the pure mathematics side and didn't focus on applications. While Gibbs and Heavyside took what they consider to be interesting about quaternions and formulated vectors and stuck to application. Second is that quaternion notion pretty much sucked, while vector notation was pretty clean. Then the two camps started the 19th century version of a flame war. Some fun quotes came out of that, but it certainly didn't help the quaternion camp, who came across as crackpots. But IMHO the real problem was: they weren't what people expected. Complex number have two values, quaternions should have three...what's that all about? If you directly translate some complex valued function into quaternions...you don't get what you expect. And that's my point about this seeming aside. If you take a complex equation simply replace complex with a quaternion...you're probably not getting what you think you are. Hamilton fell into this trap. In
C a (scaled) rotation about the origin is:
p' = rp. Although Cayley (of linear algebra fame) formulated a generalized unscaled 3D rotation pretty much straight away:
p' = rpr-1 and scaled rotations:
p' = rpr*..Hamilton resisted these equations for about 10 years. Jump to today the situation hasn't improved all that much. Quaternion literature pretty much blow chunks. The only reasonable paper that comes to mind is an old raytracing new post by Shoemake. So if there actually is anything of vague interest in here, then I suppose it's because the literature has failed us.
Forgive me in advance for my brain-dump style. Jumping back to
C. I'll write a complex number as a pair of real values:
(x,y)p' = p2 + c, with
c = p0While this isn't a linear transform globally, it can be viewed as one locally:
p' = rp + tis a scaled rotation by 'r' followed a translation by 't'. Where we're simply interpreting 'p' is multiple ways. So within an infinitesimal region around p we have a linear transform and as we move further way we, speaking loosely, the transform is local feature preserving (I'm not convinced that conformal mapping is required). Expanding things out we have:
p = (x,y), then
p' = (x2-y2, 2xy) + p0which the programmer in me can't help but note that this form leads to catastrophic cancellation and should be reformulated as (probably doesn't make a bit of difference):
p2 = ((x+y)(x-y), 2xy)Although the explicit representation of complex number is in the form
(x,y), it can be viewed to implicitly represent:
m(cos(t), sin(t)), where m is the magnitude (m>=0) and t is the torque minimal angle (-pi > t >= pi) with respect to the positive x direction. Other than addition, the action of operators are more clear in this form. Notice that in
C a direct represenation of a point and the scaled rotation of (1,0) to that point are identical.
Side-stepping to principle powers, with
p = m(cos(t), sin(t)), then:
pr = mr(cos(rt), sin(rt))Ok, I'm even starting to bore myself so I'll move on. I saw someone ask: "Isn't this feature mirrored about the x-axis?". If you use the basic form above, without any extensions this must be true for all points. Reasoning: For all points p above the x-axis are a corresponding mirrored points p
* and:
(p*p* + c*) = (p2 + c)*Now for an observation that I haven't seen mentioned: Folding about the y-axis is related to squaring and can be expressed algebraically as:
(p2)1/2Of absolutely no interest computationally, but could be useful in reasoning. And since you can fold about one line, via transforms you can fold about any. I haven't thought this through, but it seems like this should generalize to any norm-like formulation:
(pr)1/r = m(cos(s), sin(s), where
s = (t % (pi/r))I doubt that there's much use of this since the domain is getting reduced, well for r > 1. And the root can be dropped for (informally) similar results and I'd guess 'n' way symmetry for integer n.
Back to quaternions and I'll quote myself from the original thread:
... I can say with a reasonable certainty that all of quaternion based fractals I've seen are based on analytic functions over quaternions. Regardless the complexity of a given analytic function, the result will be Complex (as in literally) and therefore bound to a plane (and that's a good thing)
I'll write a full quaternion as
(s, (x,y,z)) where 's' is the scalar and
(x,y,z) is the bivector. If the scalar is zero, I'll simply write
(x,y,z).
In my geometric interpretation of the equation in
C we're performing a transform: scaled rotation + translation, where the rotation and translation are both interpretations of the point. One possible way to construct a similar system in
H would be:
p' = qpq* + p0Notice that p, p' and p
0 are all bivectors only (pure quaternions in traditionally speak) so explicitly there are only three components in this formulation.
So the question becomes, what's 'q'? A first guess could be the quaternion which rotates some unit magnitude point in some reference direction, say
r = (1,0,0) into
p = (x,y,z). Or:
p = qrq*, so q = sqrt(pr*) = sqrt(x,(0,-z,y)) = sqrt((dot(r,p), cross(r,p))which reduces to:
p' = qpq*+c = (x2-y2-z2, 2xy, 2xz)+ccompare the form to what we would have got by calling
p = (x,(y,z,0)):
p2 = (x2-y2-z2, (2xy, 2xz,0))Which was my initial purpose. To translate an equation which generates a surface of revolution (SOR) of the Mandelbrot out of a formulation in
C into a logical equivalent in
H using geometric operations instead of a direct translation. So one possible answer the the question
"How do we perform the equivalent of squaring in 3D?" in quaternion speak (which extends to say Clifford/Geometric algebras for instance) is:
qpq* where
q = sqrt(pr*).
The result squares the magnitude of 'p' and doubles the torque minimal angle with respect to the direction 'r'.
Now there's no reason why 'r' needs to be fixed for all points, nor that it remain fixed across iterations as long the scheme results in sufficient increase of angles globally to get the required folding like effect. Nor is there any particular reason why the translation couldn't be transformed across iterations and/or pre transformed at the start. Also instead of directly representing a point it could be implicit and at iteration step the total rotation is the value being updated and the point is simply a temporary. I'd guess this would be a more promising route...but I'll ignore that and these other additional ideas for the moment.
To not be a SOR requires a non-analytic function..or more simply that all points cannot remain in the complex plane in which they began. The simplest thing would be just to reflect about an axis through the origin. So taking the above and toss in a reflection after each rotation:
p' = (x2-y2-z2, 2xy, -2xz)+cNow this is an obvious thing to try anyway, so I'm sure this isn't too interesting and I'd guess locally it looks like a SOR. Simply hitting the side with a hammer each turn of the lathe isn't going to change the result all that much.
OK..that's enough garbage to spew in case all of this is old hat. Oh yeah, and on review for obvious errors I see that my "tone" here sucks and I can't be bothered to rewrite...so really feel free to mock me.
(EDIT: folding stated wrong axis and fixed a couple of spelling mistakes)