User:Or Aviram/sandbox

Since I don't know how to save stuff, I will write what I want to put for Quaternions here and copy it to the actual page later.

I will just copy the things around my part and remember that I should just make the actual page look like mine.

Functions of a quaternion variable
Like functions of a complex variable, functions of a quaternion variable suggest useful physical models. For example, the original electric and magnetic fields described by Maxwell were functions of a quaternion variable.

Exponential, logarithm, and power
Given a quaternion,
 * $$ q= a+ bi + cj + dk = a + \mathbf{v} $$

the exponential is computed as
 * $$\exp(q) = \sum_{n=0}^\infty \frac{q^n}{n!}=e^{a} \left(\cos \|\mathbf{v}\| + \frac{\mathbf{v}}{\|\mathbf{v}\|} \sin \|\mathbf{v}\|\right) $$


 * $$\ln(q) = \ln \|q\| + \frac{\mathbf{v}}{\|\mathbf{v}\|} \arccos \frac{a}{\|q\|}$$.

It follows that the polar decomposition of a quaternion may be written
 * $$q=\|q\|e^{\hat{n}\theta} = \|q\| \left(\cos(\theta) + \hat{n} \sin(\theta)\right),$$

where the angle $$\theta$$ and the unit vector $$\hat{n}$$ are defined by:
 * $$a=\|q\|\cos(\theta)$$

and
 * $$\mathbf{v}=\hat{n} \|\mathbf{v}\|=\hat{n}\|q\|\sin(\theta).$$

Any unit quaternion may be expressed in polar form as $$e^{\hat{n}\theta}$$.

The power of a quaternion raised to an arbitrary (real) exponent $$\alpha$$ is given by:
 * $$q^\alpha=\|q\|^\alpha e^{\hat{n}\alpha\theta} = \|q\|^\alpha \left(\cos(\alpha\theta) + \hat{n} \sin(\alpha\theta)\right).$$

Exponential and Logarithm Derivations
Let $$v,q\in H$$ be defined as $$v = bi + cj + dk$$ and $$q = a + bi + cj + dk = a + v$$.

Exponential:
Using exponent properties, the exponential of q can be rewritten as$$\exp(q) = e^q = e^{a + v} = e^a e^v = \exp(a)e^v.$$

The exponential of a is just the normal real-valued exponential function. To calculate $$e^v$$, we will have to use an extension of Euler's Formula for quaternions. For that, we will need some powers of v:$$\begin{array}{lcl} v^0 = 1 = |v|^0 \\ v^1 = v \\ v^2 = (0, \vec{v})(0, \vec{v}) = (-\vec{v} \cdot \vec{v}, 0\vec{v} + 0\vec{v} + \vec{v} \times \vec{v}) = -|v|^2 \\ \end{array}$$

Using those three powers, we can write a formula for v^n for two cases of n:

Case 1: n is even
"That means $n = 2k$ for some $k \in Z^+$.""v"

Case 2: n is odd
"That means $n = 2k + 1$ for some $k \in Z^+$.""v"Using those facts about the powers of v and the Maclaurin series of $$e^x$$, we can find $$e^v$$.

$$e^v = 1 + v + \frac{v^2}{2!} + \frac{v^3}{3!} + \frac{v^4}{4!} + \frac{v^5}{5!} + \frac{v^6}{6!} + \frac{v^7}{7!} + \cdot \cdot \cdot$$$$= 1 + v + \frac{v^2}{2!} + \frac{v^{2*1+1}}{3!} + \frac{v^{2*2}}{4!} + \frac{v^{2*2+1}}{5!} + \frac{v^{2*3}}{6!} + \frac{v^{2*3+1}}{7!} + \cdot \cdot \cdot$$$$= 1 + v - \frac{|v|^2}{2!} - v\frac{|v|^2}{3!} + \frac{|v|^{4}}{4!} + v\frac{|v|^{4}}{5!} - \frac{|v|^{6}}{6!} - v\frac{|v|^{6}}{7!} + \cdot \cdot \cdot$$$$= (1 - \frac{|v|^2}{2!} + \frac{|v|^4}{4!} - \frac{|v|^6}{6!} + \cdot \cdot \cdot) + v(1 - \frac{|v|^2}{3!} + \frac{|v|^4}{5!} - \frac{|v|^6}{7!} + \cdot \cdot \cdot)$$$$= \cos|v| + v\frac{1}{|v|}(|v| - \frac{|v|^3}{3!} + \frac{|v|^5}{5!} - \frac{|v|^7}{7!} + \cdot \cdot \cdot)$$$$= \cos|v| + v\frac{1}{|v|}(\sin|v|)$$$$e^v = \cos|v| + \frac{v}{|v|}\sin|v|$$ Putting this together with the equation at the start, we get the formula for calculating the exponential of a quaternion:$$\exp(q) =\exp(a)(\cos|v| + \frac{v}{|v|}\sin|v|)$$

Logarithms:
Let $$u = xi + yj + zk$$ and $$p = w + u = \ln q$$. Taking the natural log on both sides, we see that $$q = e^p$$. Using the formula derived before for the exponential of p, we can solve for p and thus have a formula for the natural log of q.

Three-dimensional and four-dimensional rotation groups
The term "conjugation", besides the meaning given above, can also mean taking an element a to rar−1 where r is some non-zero element (quaternion). All elements that are conjugate to a given element (in this sense of the word conjugate) have the same real part and the same norm of the vector part. (Thus the conjugate in the other sense is one of the conjugates in this sense.)

Thus the multiplicative group of non-zero quaternions acts by conjugation on the copy of R3 consisting of quaternions with real part equal to zero. Conjugation by a unit quaternion (a quaternion of absolute value 1) with real part cos(θ) is a rotation by an angle 2θ, the axis of the rotation being the direction of the imaginary part. The advantages of quaternions are: The set of all unit quaternions (versors) forms a 3-sphere S3 and a group (a Lie group) under multiplication, double covering the group SO(3, R) of real orthogonal 3×3 matrices of determinant 1 since two unit quaternions correspond to every rotation under the above correspondence. See the plate trick.The image of a subgroup of versors is a point group, and conversely, the preimage of a point group is a subgroup of versors. The preimage of a finite point group is called by the same name, with the prefix binary. For instance, the preimage of the icosahedral group is the binary icosahedral group.
 * 1) Nonsingular representation (compared with Euler angles for example).
 * 2) More compact (and faster) than matrices.
 * 3) Pairs of unit quaternions represent a rotation in 4D space (see Rotations in 4-dimensional Euclidean space: Algebra of 4D rotations).

The versors' group is isomorphic to SU(2), the group of complex unitary 2×2 matrices of determinant 1.

Let A be the set of quaternions of the form a + bi + cj + dk where a, b, c, and d are either all integers or all rational numbers with odd numerator and denominator 2. The set A is a ring (in fact a domain) and a lattice and is called the ring of Hurwitz quaternions. There are 24 unit quaternions in this ring, and they are the vertices of a regular 24-cell with Schläfli symbol {3,4,3}. They correspond to the double cover of the rotational symmetry group of the regular tetrahedron. Similarly, the vertices of a regular 600-cell with Schläfli symbol {3,3,5} can be taken as the unit icosians, corresponding to the double cover of the rotational symmetry group of the regular icosahedron. The double cover of the rotational symmetry group of the regular octahedron corresponds to the quaternions that represent the vertices of the disphenoidal 288-cell.