Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Properly normalizing a dual quaternion

I'm having trouble with dual quaternions, and I believe it's because they're not properly normalized. A, B and A' are dual quaternions where the latter is conjugated. When doing this: Q = A * B * A' I should theoretically always end up with Q = B if A and B are properly normalized. But in some cases, I don't, and it's completely messing up my whole skeletal hierarchy.

Many pages show that the norm of a dual quaternion is ||Q|| = sqrt(QQ'), but that means taking the square root of a dual number, and I have no idea how to do that. So right now I'm just dividing the whole thing by the length of the real part.

I've been searching around for days, but I still have yet to find a good code example on how to use dual quaternions. I feel I know the theory pretty well, but I still can't get it to work.

like image 850
Sindre Avatar asked Dec 06 '25 09:12

Sindre


1 Answers

As the OP correctly notes, but none of the other answers correctly addresses, the squared norm QQ* of a dual quaternion Q is in general a dual number. That is

QQ* = s + tε

In order for QQ* to equal 1, we must have s=1 AND t=0. The t=0 part is being ignored in the other answers but this poses an extra condition on the coefficients that we should incorporate. To correctly normalize our Q we need to divide by the square root of QQ*. Hence we should calculate the inverse square root of a dual number. This is given, for a dual number of the form s + tε by

u = 1/√s

1/√(s + tε) = u - tu³/2 ε

The proof of the above follows from direct calculation. We first square the expression:

(u - tu³/2 ε)(u - tu³/2 ε) = u² - tu⁴

substituting u back to 1/√s and multiplying with s + tε we find

u² - tu⁴ = (1/s - t/s² ε)

(1/s - t/s² ε)(s + tε) = s/s + t/s ε - t/s ε = 1

as required. This new dual number u - tu³/2 ε can now trivially be multiplied with Q to produce a normalized Q which will correctly satisfy QQ* = 1 + 0ε = 1.

like image 142
enki Avatar answered Dec 09 '25 03:12

enki



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!