rotations in the complex plane / trigonometry
definition of exponential function:

exponential of imaginary value:
$exp(i \theta) = \Sigma_{m=0}^\infty \frac{(i \theta)^m}{m!}$
$= \Sigma_{m=0}^\infty (-1)^m \frac{1}{(2 m)!} \theta^{(2 m)} + \Sigma_{m=0}^\infty (-1)^m \frac{1}{(2 m + 1)!} \theta^{(2 m + 1)}$
$= cos(\theta) + i sin(\theta)$
This is called Moore's law, or DeMoore's law, or something like that.

Inverse of imaginary exponential map / rotation formula:
$exp(-i \theta) = cos(-\theta) + i sin(-\theta)$
$ = cos(\theta) - i sin(\theta)$
Therefore
$cos(\theta) = \frac{1}{2}( exp(i \theta) + exp(-i \theta))$
$sin(\theta) = \frac{1}{2 i}( exp(i \theta) - exp(-i \theta))$

Complex rotations:
$(x' + i y') = exp(i \theta) (x + i y)$



rotations in 2D using a matrix in place of 'i'

Let $A = \left[ \begin{matrix} 0 & -\theta \\ \theta & 0 \end{matrix} \right]$
$A^2 = \left[ \begin{matrix} -\theta^2 & 0 \\ 0 & -\theta^2 \end{matrix} \right] = -\theta^2 I$
$A^3 = \left[ \begin{matrix} 0 & \theta^3 \\ -\theta^3 & 0 \end{matrix} \right] = -\theta^2 A$
$A^4 = \left[ \begin{matrix} \theta^4 & 0 \\ 0 & \theta^4 \end{matrix} \right] = \theta^4 I = \theta^4 A^0$

The exponential map of A is calculated as:
$exp(A) = \Sigma_{n=0}^\infty \frac{1}{n!} A^n$
$exp(A) = \left[ \begin{matrix} 1 & 0 \\ 0 & 1 \end{matrix} \right] + \left[ \begin{matrix} 0 & -\theta \\ \theta & 0 \end{matrix} \right] + \frac{1}{2} \left[ \begin{matrix} -\theta^2 & 0 \\ 0 & -\theta^2 \end{matrix} \right] + \frac{1}{3!} \left[ \begin{matrix} 0 & \theta^3 \\ -\theta^3 & 0 \end{matrix} \right] + \frac{1}{4!} \left[ \begin{matrix} \theta^4 & 0 \\ 0 & \theta^4 \end{matrix} \right] + \frac{1}{5!} \left[ \begin{matrix} 0 & -\theta^5 \\ \theta^5 & 0 \end{matrix} \right] + ... $
$exp(A) = \left[ \begin{matrix} 1 & 0 \\ 0 & 1 \end{matrix} \right] + \theta \left[ \begin{matrix} 0 & -1 \\ 1 & 0 \end{matrix} \right] + \frac{1}{2} \theta^2 \left[ \begin{matrix} -1 & 0 \\ 0 & -1 \end{matrix} \right] + \frac{1}{3!} \theta^3 \left[ \begin{matrix} 0 & 1 \\ -1 & 0 \end{matrix} \right] + \frac{1}{4!} \theta^4 \left[ \begin{matrix} 1 & 0 \\ 0 & 1 \end{matrix} \right] + \frac{1}{5!} \theta^5 \left[ \begin{matrix} 0 & -1 \\ 1 & 0 \end{matrix} \right] + ... $
$exp(A) = \left[ \begin{matrix} \frac{1}{0!} \theta^0 - \frac{1}{2!} \theta^2 + \frac{1}{4!} \theta^4 - ... & -\frac{1}{1!} \theta + \frac{1}{3!} \theta^3 - \frac{1}{5!} \theta^5 +... \\ \frac{1}{1!} \theta - \frac{1}{3!} \theta^3 + \frac{1}{5!} \theta^5 - ... & \frac{1}{0!} \theta^0 - \frac{1}{2!} \theta^2 + \frac{1}{4!} \theta^4 - ... \end{matrix} \right]$
$exp(A) = \left[ \begin{matrix} cos(\theta) & -sin(\theta) \\ sin(\theta) & cos(\theta) \end{matrix} \right]$

2D rotation:
$\left[ \begin{matrix} x' \\ y' \end{matrix} \right] = \left[ \begin{matrix} cos \theta & -sin \theta \\ sin \theta & cos \theta \end{matrix} \right] \left[ \begin{matrix} x \\ y \end{matrix} \right]$



rotations in $\textbf{R}^3$

3D (and higher?) rotations
rotation around an axis $\vec{n}$ by some angle $\theta$:
for unit vector $\vec{n} = n^i e_i$
for initial vector $\vec{x}$ and result vector $\vec{x}'$
$\vec{x}' = R(\vec{n}, \theta) \vec{x}$

Let $\vec{\omega} = \omega_i e^i = \theta n_i e^i$

Exponential map:
in 3D:
$exp( {\epsilon_{ij}}^k \omega_k ) = \Sigma_{m=0}^\infty ( {\epsilon_{ij}}^k \omega_k)^m$
Let $A_{ij} = {\epsilon_{ij}}^k \omega_k$
$A = \left[ \begin{matrix} 0 & \omega_z & -\omega_y \\ -\omega_z & 0 & \omega_x \\ \omega_y & -\omega_x & 0 \end{matrix} \right] = \star \vec{\omega}$
Notice that $\star (a \wedge b) = a^\sharp \lrcorner \star b = a \times b$
Therefore $(\star \vec{\omega}) \cdot \vec{\omega} = \vec{\omega} \times \vec{\omega} = 0$
$A^2 = \left[ \begin{matrix} -((\omega_y)^2 + (\omega_z)^2) & \omega_x \omega_y & \omega_x \omega_z \\ \omega_x \omega_y & -((\omega_x)^2 + (\omega_z)^2) & \omega_y \omega_z \\ \omega_x \omega_z & \omega_y \omega_z & -((\omega_x)^2 + (\omega_y)^2) \end{matrix} \right] = \vec{\omega} \otimes \vec{\omega} - I |\omega|^2$
$A^3 = \left[ \begin{matrix} 0 & -\omega_z |\omega|^2 & \omega_y |\omega|^2 \\ \omega_z |\omega|^2 & 0 & -\omega_x |\omega|^2 \\ -\omega_y |\omega|^2 & \omega_x |\omega|^2 & 0 \end{matrix} \right] = (\star \omega) \cdot (\vec{\omega} \otimes \vec{\omega} - I |\omega|^2) = -(\star \omega) |\omega|^2 = -|\omega|^2 A$
$A^4 = \left[ \begin{matrix} ( (\omega_y)^2 + (\omega_z)^2) |\omega|^2 & -\omega_x \omega_y |\omega|^2 & -\omega_x \omega_z |\omega|^2 \\ -\omega_x \omega_y |\omega|^2 & ( (\omega_x)^2 + (\omega_z)^2) |\omega|^2 & -\omega_y \omega_z |\omega|^2 \\ -\omega_x \omega_z |\omega|^2 & -\omega_y \omega_z |\omega|^2 & ( (\omega_x)^2 + (\omega_y)^2) |\omega|^2 \end{matrix} \right] = -(\vec{\omega} \otimes \vec{\omega} - I |\omega|^2) |\omega|^2 = -|\omega|^2 A^2 $
$A^5 = \left[ \begin{matrix} 0 & \omega_z |\omega|^4 & -\omega_y |\omega|^4 \\ -\omega_z |\omega|^4 & 0 & \omega_x |\omega|^4 \\ \omega_y |\omega|^4 & -\omega_x |\omega|^4 & 0 \end{matrix} \right] = (\star \vec{\omega}) |\omega|^4 = A |\omega|^4$

$exp(A) = \Sigma_{n=0}^\infty \frac{1}{n!} A^n$
$exp(A) = \frac{1}{0!} A^0 + \frac{1}{1!} A^1 + \frac{1}{2!} A^2 + \frac{1}{3!} A^3 + \frac{1}{4!} A^4 + \frac{1}{5!} A^5 + ...$
$exp(A) = \frac{1}{0!} I + \frac{1}{1!} (\star \vec{\omega}) + \frac{1}{2!} (\vec{\omega} \otimes \vec{\omega} - I |\omega|^2) + \frac{1}{3!} (-(\star \omega) |\omega|^2) + \frac{1}{4!} (-(\vec{\omega} \otimes \vec{\omega} - I |\omega|^2) |\omega|^2) + \frac{1}{5!} ((\star \vec{\omega}) |\omega|^4) + ... $
$exp(A) = \frac{1}{0!} I - \frac{1}{2!} |\omega|^2 I + \frac{1}{4!} |\omega|^4 I + \frac{1}{1!} \star \vec{\omega} - \frac{1}{3!} \star \vec{\omega} |\omega|^2 + \frac{1}{5!} \star \vec{\omega} |\omega|^4 + \frac{1}{2!} \vec{\omega} \otimes \vec{\omega} - \frac{1}{4!} |\omega|^2 \vec{\omega} \otimes \vec{\omega} + ... $
$exp(A) = I ( \frac{1}{0!} |\omega|^0 - \frac{1}{2!} |\omega|^2 + \frac{1}{4!} |\omega|^4 - ... ) + \vec{\omega} \otimes \vec{\omega} ( \frac{1}{2!} - \frac{1}{4!} |\omega|^2 + ... ) + \star \vec{\omega} ( \frac{1}{1!} - \frac{1}{3!} |\omega|^2 + \frac{1}{5!} |\omega|^4 - ... ) $
$exp(A) = I cos|\omega| + \vec\omega \otimes \vec\omega (1 - cos|\omega|) + \star \vec{\omega} sin|\omega| $
$exp(A) = (I - \vec\omega \otimes \vec\omega) cos|\omega| + \star \vec{\omega} sin|\omega| + \vec\omega \otimes \vec\omega $
aka Rodrigues rotation formula, with angle $|\omega|$ and axis $\frac{\vec\omega}{|\omega|}$.

rotations in $\textbf{R}^n$

Cartesian basis: $e_i$
inner product: $e_i \cdot e_j = \delta_{ij}$ for $\delta_{ij} =$ Kronecker delta.

exponential map:
$exp(x) = \Sigma_{m=0}^\infty \frac{x^m}{m!}$


... TODO some work...
$ = \delta_{ij} cos(\theta) + n_i n_j (1 - cos(\theta)) + \epsilon_{ijk} n^k sin(\theta)$
(aka Rodrigues rotation formula)


In any dimension:
Let A be an antisymmetric matrix. Spoilers that this can be represented as the components of $a \wedge b$ in some basis.
TODO ...



hyperbolic trigonometry

$cosh(\alpha) = \frac{1}{2} (exp(\alpha) + exp(-\alpha))$
$sinh(\alpha) = \frac{1}{2} (exp(\alpha) - exp(-\alpha))$

Taylor expansion:
$cosh(\alpha) = \Sigma_{m=0}^\infty \frac{1}{(2 m)!} \alpha^{(2 m)}$
$sinh(\alpha) = \Sigma_{m=0}^\infty \frac{1}{(2 m + 1)!} \alpha^{(2 m + 1)}$



hyperbolic rotations in 2D

Let $A = \left[ \begin{matrix} 0 & \alpha \\ \alpha & 0 \end{matrix} \right]$
$A^2 = \left[ \begin{matrix} \alpha^2 & 0 \\ 0 & \alpha^2 \end{matrix} \right]$
$A^3 = \left[ \begin{matrix} 0 & \alpha^3 \\ \alpha^3 & 0 \end{matrix} \right]$
$A^4 = \left[ \begin{matrix} \alpha^4 & 0 \\ 0 & \alpha^4 \end{matrix} \right]$

Let $\hat{A} = \frac{1}{\alpha} A$

$exp(A) = I + \alpha \hat{A} + \frac{1}{2} \alpha^2 \hat{A}^2 + ...$
$exp(A) = I (1 + \frac{1}{2!} \alpha^2 + \frac{1}{4!} \alpha^4 + ...) + \hat{A} (\alpha + \frac{1}{3!} \alpha^3 + \frac{1}{5!} \alpha^5 + ....)$
$exp(A) = cosh(\alpha) I + sinh(\alpha) \hat{A}$
$exp(A) = \left[ \begin{matrix} cosh(\alpha) & sinh(\alpha) \\ sinh(\alpha) & cosh(\alpha) \end{matrix} \right]$



hyperbolic rotation in 3D

Let $A = \left[ \begin{matrix} 0 & \alpha_3 & \alpha_2 \\ \alpha_3 & 0 & \alpha_1 \\ \alpha_2 & \alpha_1 & 0 \end{matrix} \right]$
Let $\hat{A} = \frac{1}{|\alpha|} A$

$A^2 = \left[ \begin{matrix} |\alpha|^2 - (\alpha_1)^2 & \alpha_1 \alpha_2 & \alpha_1 \alpha_3 \\ \alpha_1 \alpha_2 & |\alpha|^2 - (\alpha_2)^2 & \alpha_2 \alpha_3 \\ \alpha_1 \alpha_3 & \alpha_2 \alpha_3 & |\alpha|^2 - (\alpha_3)^2 \end{matrix} \right]$
Let $v = 2 \alpha_1 \alpha_2 \alpha_3$
$A^3 = \left[ \begin{matrix} 2 \alpha_1 \alpha_2 \alpha_3 & \alpha_3 |\alpha|^2 & \alpha_2 |\alpha|^2 \\ \alpha_3 |\alpha|^2 & 2 \alpha_1 \alpha_2 \alpha_3 & \alpha_1 |\alpha|^2 \\ \alpha_2 |\alpha|^2 & \alpha_1 |\alpha|^2 & 2 \alpha_1 \alpha_2 \alpha_3 \end{matrix} \right] = |\alpha|^2 \left[ \begin{matrix} \frac{v}{|\alpha|^2} & \alpha_3 & \alpha_2 \\ \alpha_3 & \frac{v}{|\alpha|^2} & \alpha_1 \\ \alpha_2 & \alpha_1 & \frac{v}{|\alpha|^2} \end{matrix} \right] = v I + |\alpha|^2 A $
$A^4 = \left[ \begin{matrix} |\alpha|^2 (|\alpha|^2 - (\alpha_1)^2) & \alpha_1 \alpha_2 (|\alpha|^2 + 2 (\alpha_3)^2) & \alpha_1 \alpha_3 (|\alpha|^2 + 2 (\alpha_2)^2) \\ \alpha_1 \alpha_2 (|\alpha|^2 + 2 (\alpha_3)^2) & |\alpha|^2 (|\alpha|^2 - (\alpha_2)^2) & \alpha_2 \alpha_3 (|\alpha|^2 + 2 (\alpha_1)^2) \\ \alpha_1 \alpha_3 (|\alpha|^2 + 2 (\alpha_2)^2) & \alpha_2 \alpha_3 (|\alpha|^2 + 2 (\alpha_1)^2) & |\alpha|^2 (|\alpha|^2 - (\alpha_3)^2) \end{matrix} \right] = |\alpha|^2 \left[ \begin{matrix} |\alpha|^2 - (\alpha_1)^2 & \alpha_1 \alpha_2 (1 + \frac{2 (\alpha_3)^2}{|\alpha|^2}) & \alpha_1 \alpha_3 (1 + \frac{2 (\alpha_2)^2}{|\alpha|^2}) \\ \alpha_1 \alpha_2 (1 + \frac{2 (\alpha_3)^2}{|\alpha|^2}) & |\alpha|^2 - (\alpha_2)^2 & \alpha_2 \alpha_3 (1 + \frac{2 (\alpha_1)^2}{|\alpha|^2}) \\ \alpha_1 \alpha_3 (1 + \frac{2 (\alpha_2)^2}{|\alpha|^2}) & \alpha_2 \alpha_3 (1 + \frac{2 (\alpha_1)^2}{|\alpha|^2}) & |\alpha|^2 - (\alpha_3)^2 \end{matrix} \right] = v A + |\alpha|^2 A^2 $

$A^5 = v A^2 + |\alpha|^2 A^3$
$A^5 = v |\alpha|^2 I + |\alpha|^4 A + v A^2 $

$A^6 = v |\alpha|^2 A + |\alpha|^4 A^2 + v A^3$
$A^6 = v |\alpha|^2 A + |\alpha|^4 A^2 + v (v I + |\alpha|^2 A)$
$A^6 = (v)^2 I + 2 v |\alpha|^2 A + |\alpha|^4 A^2 $
$A^6 = (v I + |\alpha|^2 A)^2 $

$exp(A) = I + A + \frac{1}{2} A^2 + ....$
$exp(A) = I + A + A^2 + \frac{1}{3!} (v I + |\alpha|^2 A) + \frac{1}{4!} (v A + |\alpha|^2 A^2) + \frac{1}{5!} ( v |\alpha|^2 I + |\alpha|^4 A + v A^2 ) + ... $
$exp(A) = I ( v \frac{1}{3!} + v |\alpha|^2 \frac{1}{5!} + (v)^2 \frac{1}{6!} ) + A( 1 + |\alpha|^2 \frac{1}{3!} + v \frac{1}{4!} + |\alpha|^4 \frac{1}{5!} + 2 v |\alpha|^2 \frac{1}{6!} ) + A^2 ( 1 + |\alpha|^2 \frac{1}{4!} + v \frac{1}{5!} + |\alpha|^4 \frac{1}{6!} ) + ... $

...bleh this seems to be going nowhere.
especially not until I find a relation between $|\alpha|^2$ and v.
And the fact that my powers are on a 3 point cycle isn't helpful for the fact that hyperbolic is 2-point rather than 4-point as non-hyperbolic exponent of imaginary expansion is.

I guess I'll just say this is the same as $exp(U A U^{-1}) = U exp(A) U^{-1})$ (does that work in general or only for diagonal A?)
And then define my new A as the old 2D A with an extra dimension tacked on the end.