Logo by MarkJayBee - Contribute your own Logo!

END OF AN ERA, FRACTALFORUMS.COM IS CONTINUED ON FRACTALFORUMS.ORG

it was a great time but no longer maintainable by c.Kleinhuis contact him for any data retrieval,
thanks and see you perhaps in 10 years again

this forum will stay online for reference
News: Follow us on Twitter
 
*
Welcome, Guest. Please login or register. October 02, 2018, 09:45:32 AM


Login with username, password and session length


The All New FractalForums is now in Public Beta Testing! Visit FractalForums.org and check it out!


Pages: [1]   Go Down
  Print  
Share this topic on DiggShare this topic on FacebookShare this topic on GoogleShare this topic on RedditShare this topic on StumbleUponShare this topic on Twitter
Author Topic: Quat sum, multiply, divide  (Read 1241 times)
0 Members and 1 Guest are viewing this topic.
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« on: February 09, 2011, 06:34:15 PM »

Dears I need some help with quaternonions. Mandelbulb3D uses quaternonion math that I do NOT know ... fiery
What is the formula for;

(a + bi + cj + dk) * (e + fi + gj + hk) = fre() + i * fc1(...) + j * fc2(...) + k * fc3(...)

and

(a + bi + cj + dk) / (e + fi + gj + hk) = fre() + i * fc1(...) + j * fc2(...) + k * fc3(...)

I only am sure that (a + bi + cj + dk) + (e + fi + gj + hk) = (a+e) + (b+f) i + ... (Simple term by term sum)

I need float functions of float coefficients to be inserted in an assembly code. alien

 sad

I am not able to find formulas by myself. It is useful for some MB3D formulas; the second is the expression of 4D Mobius map (with a = (a1-a2) and stuff).

I also need;

(a + bi + cj ) * (d + ei + fj ) = fre() + i * fc1(...) + j * fc2(...)

and

(a + bi + cj ) / (d + ei + fj ) = fre() + i * fc1(...) + j * fc2(...)

(Quaternonions without fourth term for simplified code in 3D only)  wink
« Last Edit: February 09, 2011, 06:36:25 PM by DarkBeam » Logged

No sweat, guardian of wisdom!
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #1 on: February 09, 2011, 07:05:58 PM »

I found the answer;

product = a1a2 − b1b2 − c1c2 − d1d2
+ (a1b2 + b1a2 + c1d2 − d1c2)i
+ (a1c2 − b1d2 + c1a2 + d1b2)j
+ (a1d2 + b1c2 − c1b2 + d1a2)k

Is it correct?

And;

z^(-1) = z / det(z) where det(z) = a*a + b*b + c*c + d*d

so composing the two formulas should give the final answer afro
Logged

No sweat, guardian of wisdom!
Fractal Ken
Fractal Lover
**
Posts: 246


Proud to be 2D


« Reply #2 on: February 09, 2011, 08:28:30 PM »

Darkbeam,

Your formula for the product (a1 + b1i + c1j + d1k)(a2 + b2i + c2j + d2k) looks right.

I believe the reciprocal of a quaternion is its conjugate divided by its squared norm. In other words, if z = a + bi + cj + dk, then

     z-1 = z* / ||z||2 = (a - bi - cj - dk) / (a2 + b2 + c2 + d2)

Here's a picky point about the quotient of two quaternions: It's not uniquely defined. We could interpret p/q as meaning either pq-1 or q-1p, and they're not generally equal due to the noncommutativity of quaternion multiplication.

The Wikipedia article on quaternions has loads of good information.

Regards,
Ken
Logged

Fortran will rise again
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #3 on: February 09, 2011, 08:54:03 PM »

Okay ty cheesy
Logged

No sweat, guardian of wisdom!
Pages: [1]   Go Down
  Print  
 
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.193 seconds with 26 queries. (Pretty URLs adds 0.01s, 2q)