1
\$\begingroup\$

I am having trouble understanding the semantics of some members of the XNA/Monogame Quaternion class. The docs are not helpful, and tutorials trying to explain quaternions are using heavy math, which isn't helpful for me either, since I simply do not have proper background for that.

My main questions currently are:

  • Is there any difference between Multiply and Concatenate?

  • What is the exact difference between Inverse and Negate?

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

There's minimal difference between concatenate and multiply, concatenate(a, b) = b * a

Inverse and negate are different. Negate flips the signs, inverse returns \$q^{-1}\$ so that \$q * q^{-1} = identity = (1, 0, 0, 0)\$, the inverse of the quaternion \$(a, b, c, d)\$ is \$\frac{a -ib-jc-kd}{a^2+b^2+c^2+d^2}\$

\$\endgroup\$
6
  • \$\begingroup\$ I'd expect Inverse({1/√2, 0, 0 1/√2}) to yield {-1/√2, 0, 0 1/√2} while Negate would yield {-1/√2, 0, 0 -1/√2}. These two rotations yield the same orientation, but the latter reaches it the long way rather than via the shortest angle. \$\endgroup\$
    – DMGregory
    Jan 8, 2019 at 14:48
  • \$\begingroup\$ What is the semantic of normalizing a Quaternion, I understand that the components will divided by the length, but what happens to the rotation then? \$\endgroup\$
    – codymanix
    Jan 8, 2019 at 15:37
  • \$\begingroup\$ @codymanix Nothing, but multiplying other quaternions with a normalized one won't change their length. This won't be guaranteed for a non-normalized one \$\endgroup\$
    – Bálint
    Jan 8, 2019 at 15:50
  • \$\begingroup\$ @DMGregory Fixed \$\endgroup\$
    – Bálint
    Jan 8, 2019 at 15:54
  • \$\begingroup\$ Does normalizing a Quaternion mean similar as make for example n*2*PI to 0.0 degrees in Euler angles? If this hasn't any drawbacks and does't affect rotation, is it recommended to normalize a Quaternion before persisting it (e.g. store into database)? \$\endgroup\$
    – codymanix
    Jan 9, 2019 at 13:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .