A Quaternion Algebra Tool Set

Parts
Simple algebra
Multiplication
Trig
Powers
Logs
Multiplying by exponentials

Here is a compilation of basic algebra for quaternions.  It should look very similar to complex algebra, since it contains three sets of complex numbers, t + x i, t + y j, and t + z k.  To strengthen the link, and keep things looking simpler, all quaternions have been written as a pair of a scalar t and a 3-vector V, as in (t, V).  All these relations have been tested in a C library and a Java quaternion calculator.

Technical note: it is vital that every tool in this set can be expressed as working with a whole quaternion q.  This will make doing quaternion analysis with automorphic functions fruitful.

Parts

The scalar of q equals q plus its conjugate over two equals (t, zero)

scalar (q) = (q + q*)/2 = (t, 0)

The vector of q equals q minus its conjugate over two equals (zero, V)

vector (q) = (q - q*)/2 = (0, V)

Simple algebra

The absolute value of q equals the square root of q times its conjugate equals (the square root of t squared plus V dot V, 0)

|q| = (Sqrt[(qq*)]) = ((Sqrt[(t^2) + V . V]), 
          0)

The norm of q equals q times its conjugate equals (t squared plus V dot V, 0)

norm (q) = qq *= ((t^2) + V . V, 0)

The determinant of q equals q times its conjugate squared equals (the square of t squared plus V dot V, 0)

((det (q) = (qq*))^2) = (((((t^2) + V . V))^2), 
        0)

The sum of q and q prime equals (t plus t', V plus V')

sum (q, q') = (t + t', V + V')

The difference of q and q prime equals (t minus t', V minus V')

dif (q, q') = (t - t', V - V')

The conjugate of q equals q* equals (t, minus V)

conj (q) = q *= (t, -V)

The inverse of q equal q conjugated over its norm equals (t, -V) over (t squared plus V dot V).

inv (q) = 
          q*/(qq*) = (t, -V)/((t^2) + 
            V . V)

The adjoint of q equals q conjugated times its norm equals (t, -V) times (t squared plus V dot V).

adj (q) = q*(qq*) = (t, -V) 
        norm (q)

Multiplication

The Grassman product as defined here uses the same rule Hamilton developed.  The Euclidean product takes the conjugate of the first of the two elements (following a tradition from quantum mechanics).

The Grassman product of q and q' equals q times q prime equals (t t prime minus V dot V prime, t V prime plus V t prime plus V cross V prime).

Grassman_product (q, q') = qq' = (tt' - V . V', 
          tV' + Vt' + V×V')

The Grassman even product of q and q' equals q times q prime plus q prime q over two equals (t t prime minus V dot V prime, t V prime plus V t prime).

Grassman_even  _product (q, 
          q') = ((qq' + q' q)/2) = (tt' - V . V', 
          tV' + Vt')

The Grassman odd product of q and q' equals q times q prime minus q prime q over two equals (zero, V cross V prime).

Grassman_odd  _product (q, q') = ((qq' - q' q)/2) = (0, 
          V×V')

The Euclidean product of q and q' equals q conjugated times q prime equals (t t prime plus V dot V prime, t V prime minus V t prime minus V cross V prime).

Euclidean_product (q, q') = q*q' = (tt' + V . V', 
          tV' - Vt' - V×V')

The Euclidean even product of q and q' equals q conjugated times q prime plus q prime q conjugated over two equals (t t prime plus V dot V prime, zero).

Euclidean_even  _product (q, 
          q') = ((q*q' + q' q*)/2) = (tt' + V . V', 0)

The Euclidean odd product of q and q' equals q conjugated times q prime minus q prime q conjugated over two equals (zero, t V prime minus V t prime minus V cross V prime).

Euclidean_odd  _product (q, q') = ((qq' - q' q)/2) = (0, 
          tV' - Vt' - V×V')

Trigonometry

The sine of q equals (sin t hyperbolic cosine absolute value of V, cosine t hyperbolic sine of the absolute value of V times V normalized to V)

sin (q) = (sin (t) cosh (|V|), 
        cos (t) sinh (|V|) V/ | 
          V | )

The cosine of q equals (cos t hyperbolic cosine absolute value of V, minus sine t hyperbolic sine of the absolute value of V times V normalized to V)

cos (q) = (cos (t) cosh (|V|), -sin (t) sinh (|V|) V/ | V | )

The tangent of q equals the sine of q times the inverse of the cosine of q

tan (q) = sin (q)/cos (q)

Note: since the unit vectors of sine and cosine are the same, these two commute so the order is irrelevant.

The arcsine of q equals minus V normalized to V times the hyperbolic arcsine of q times V normalized to V.

asin (q) = -V/ | V | 
        asinh (q V/ | V | )

The arccosine of q equals minus V normalized to V times the hyperbolic arccosine of q.

acos (q) = -V/ | V | acosh (q)

The arctangent of q equals minus V normalized to V times the hyperbolic arctangent of q times V normalized to V.

atan (q) = -V/ | V | 
        atanh (q V/ | V | )

The hyperbolic sine of q equals (hyperbolic sin t cosine absolute value of V, hyperbolic cosine t sine of the absolute value of V times V normalized to V)

sinh (q) = (sinh (t) cos (|V|), 
        cosh (t) sin (|V|) V/ | 
          V | )

The hyperbolic cosine of q equals (hyperbolic cos t cosine absolute value of V, hyperbolic sine t sine of the absolute value of V times V normalized to V)

cosh (q) = (cosh (t) cos (|V|), 
        sinh (t) sin (|V|) V/ | 
          V | )

The hyperbolic tangent of q equals the hyperbolic sine of q times the inverse of the hyperbolic cosine of q

tanh (q) = sinh (q)/cosh (q)

The hyperbolic arcsine of q equals the natural log of (q plus the square root of q squared plus q).

asinh (q) = ln (q + (q^2 + 1)^ .5)

The hyperbolic arccosine of q equals the natural log of (q plus or minus the square root of q squared minus one).

acosh (q) = ln (q + /-(q^2 - 1)^ .5)

The hyperbolic arctangent of q equals one half times the natural log of (one plus q over one minus q).

atanh (q) =  .5 ln ((1 + q)/(1 - q))

Powers

The exponential of q equals (e to the t cosine absolute value of V, e to the t sine of the absolute value of V times V normalized to V)

exp (q) = (exp (t) cos (|V|), 
        exp (t) sin (|V|) V/ | 
          V | )

q raised to the q prime equals the exponential of the natural log of q time q prime.

q^q' = exp (ln (q) x q')

Logs

The natural log of q equals (one half times the natural log of t squared plus V dot V, the arctan of absolute value of V, angle t time V normalized to V.

ln (q) = (0.5 ln (t^2 + V . V), 
        atan2 (|V|, t) V/ | 
          V | )

The log base 10 equals the natural log of q over the natural log of 10.

log (q) = ln (q)/ln (10)

Quaternion exponential multiplication

The Grassman product of two exponentials q and q' equals the even Grassman product times the absolute value of the odd Grassman product times the exponential of pi over 2 times the odd Grassman product normalized to itself.

q q' = {q, q'}+  | [q, q'] | 
        exp (pi[q, q']/2 | [q, q'] | )

The Euclidean product of two exponentials q and q' equals the even Euclidean product times the absolute value of the odd Euclidean product times the exponential of pi over 2 times the odd Euclidean product normalized to itself.

q*q' = {q*, q'}+  | [q*, q'] | 
        exp (pi[q*, q']/2 | [q*, 
                q'] | )

Andrew Millard suggested the result for the Grassman product.