Logo by Trifox - 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: Support us via Flattr FLATTR Link
 
*
Welcome, Guest. Please login or register. April 19, 2024, 05:07:46 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 2340 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:  

Related Topics
Subject Started by Replies Views Last post
Flowers and the Great Divide Images Showcase (Rate My Fractal) element90 0 1452 Last post August 31, 2011, 01:30:01 PM
by element90
Quat 1.2, no parameters dialog box ? Others chaos_crystal 3 1927 Last post December 25, 2012, 06:20:05 AM
by cKleinhuis
Bridges Crossing the Divide Images Showcase (Rate My Fractal) element90 12 1017 Last post February 21, 2014, 10:50:39 AM
by cKleinhuis
MBR_V2.05 Quat-Mbulb Test t37 Mandelbulber Gallery mclarekin 0 945 Last post September 01, 2015, 01:48:52 PM
by mclarekin
someone i can hire to divide a fractal temple rendering into pieces to 3d print Commission an Artist living4resonance 4 1942 Last post June 12, 2017, 07:26:47 PM
by 0xbeefc0ffee

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.181 seconds with 24 queries. (Pretty URLs adds 0.007s, 2q)