Skip to content

Instantly share code, notes, and snippets.

@Marc-B-Reynolds
Last active December 16, 2015 15:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Marc-B-Reynolds/9af91248bc9da37cdbe9 to your computer and use it in GitHub Desktop.
Save Marc-B-Reynolds/9af91248bc9da37cdbe9 to your computer and use it in GitHub Desktop.

This is total shit quickly banged out in probably hard to follow semi-formalism.

TL/DR part, skip to next section

Complex numbers (C) can be viewed as a scalar bivector pair. A 2D bivector requires 1 element (note 1), so we have C ~= R1+R1 ~= R2 with basis {1,i}.

Denote a complex number: z = a+bi = (a, b), {a,b} on R. Associating C with R2 we can interpret (a,b) as a coordinate (in the plane). Functions over C map coordinates in the plane to other coordinates in the plane. We can define principle value (single valued) functions for: log, exp and powers (among others).

For power we can rewrite 'z' into a polar form z = m(cos(a), sin(a)), m >= 0, a on [pi,-pi). Then the princle power can be denoted as:

zt = mt(cos(ta), sin(ta))

which linearly parameterizes the minimum magnitude angle between (1,0) and 'z'. If |z|=1, then 't' follows the circular arc.

Quaternions (H) extends C from 2 to 3 dimensions. So we have a scalar bivector pair, but now the bivector is 3D and requires 3 elements (note 1), so we have H ~= R1+R3 ~= R4 with basis {1,i,j,k}. Denote quaternion as: q=a+bI, {a,b} on R, I={u on R3, |u|=1} (a unit bivector).

Since I2=-1 for all choices of unit bivectors the set of all quaternions with fixed 'I' fall in the same complex plane. An implication of this is all analytic functions over H are equivalent the same function over C. That is they map coordinates in a complex plane into coordinates in the same complex plane. The action is in a 2 dimensional subspace. The princle power is an example of an analytic function. The complex plane in question is unique iff 'q' not in R.

The entire set of quaternions can be viewed as a infinite collection of complex planes, one per unique direction in R3 (the set of all unit bivectors).

Real part of this note

I made a vague comment that pretty much all CG uses of quaternions are 2 dimensional.

CONJUGATE/INVERSE: (a+bI)* = a-bI. Same plane. Multiplicative inverse is conjugate + scale = same plane.

SLERP: Linear parameterize angle between start 'a' and end 'b' (assuming dot(a,b) >= 0). The principle power performs this action between '1' and 'q'. Transform {a,b} -> {1,q}, perform power, and transform back to original space. Since the quaternion product does not generally commute, there are two forms:

S(a,b,t) = (ba-1)ta = a(a-1b)t

(note 2) as a linear transform of the princple power, slerp falls in a plane and is 2D. Plane spanning {a,b,0}.

LERP: same as SLERP, instead of falling on the arc..the result falls on the coord of the arc in the same plane.

PRODUCT: Let c=ab. To visualize the action continously: S(a,ab,t) -> action in a plane, therefore 2D.

SIMILARITY TRANSFORM: p' = qpq-1. Don't think I need to say anything here. (note 2).

NOTES:

  1. A bivector in 'n' dimension requires Binomial[n,2] elements
  2. q-1 = q* iff |q|=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment