Skip to content

Instantly share code, notes, and snippets.

@shrinktofit
Last active May 18, 2023 08:21
Show Gist options
  • Save shrinktofit/0948fa0a8c6d3fc40027a0daef54f1ac to your computer and use it in GitHub Desktop.
Save shrinktofit/0948fa0a8c6d3fc40027a0daef54f1ac to your computer and use it in GitHub Desktop.
inverse transform

Let $b$ be the inverse of $a$, then for the translation term $T$(Vector), rotation term $Q$(Quaternion), scale term $S$(Vector):

$$\begin{equation} \begin{split} T_(a * b) & = T_b + (Q_b \times (S_b \times T_a) \times Q_b^{-1}) = 0 \\\ T(b) & = -(Q_b \times S_b \times T_a \times Q_b^{-1}) \\\ & = Q_b \times (S_b \times -T_a) \times Q_b^{-1} \end{split} \end{equation}$$

Which equals to:

  • Translate by $-T_a$
  • Then scale by the $S_b$(ie. $S_a^{-1}$)
  • Then rotate by $Q_b$(ie. $Q_a^{-1}$)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment