This was part of a draft version of “Quaternion half/double angle and Cayley transforms”. I broke this out because the methods are indepenent of either and are simply implications of computing relative quaternions and using the similarity transform.

We can rotate a bivector with the quaternion similarity transform. Given unit quaternion $Q$ then the rotation of $a$ to $b$ can be expressed as:

When $a$ and $b$ are unit bivectors then solving for $Q$ yields:

Using the previous and a known $a$ we can implictly represent $b$ by $Q$. Since we have bivector inputs $\eqref{xform}$ can be reduced:

Breaking down these two steps:

  • Extract the relative angle information of $b$ with respect to $a$ is: $ba^*$. This can also be expressed as: $ba^{-1}$. The difference is the former composes the scale and the later computes relative scale. These hold for quaternions in general.

  • Once we have the relative information applying the half-angle transform (square root) completes the forward transform.

I will only talk about unit bivectors but the same holds for arbitrary magnitude the math just needs to be carried through for that case.

Notice that the action here is really two dimensional. The first products’ role to to change our angle measuring stick from the direction of positive reals to the direction of $a$. It simply maps a unit sphere to a unit sphere. The square root is a complex valued function so the action is in 2D: $ \mathbf{ba}^* $ and $ \sqrt{\mathbf{ba}^*} $ are in the sample complex plane, the plane that spans {$1, a\times b $}.

Example: let $b$ be up (as in positive $z$)

As an example we can create a context free representation of normals by choosing a reference direction like positive $z$. Renaming $\mathbf{a}$ to $\mathbf{z}$ and $\mathbf{b}$ to $\mathbf{n}$ with:

then $Q$ can be expressed as:

Renaming this result as:

When $\mathbf{n}=-\mathbf{z}$ the equation explodes but the result is not infinity. We have $\sqrt{-1}$ which generally for quaternions means “any unit bivector” so $a=0$ and $(-b)^2+c^2=1$. Following through with $Q$ is a rotation that maps $\mathbf{z}$ to $-\mathbf{z}$ leads to the same result.

At this point we have all the constraints on the values as listed at the end of the Preliminary stuff section of the half-angle/Cayley post1. Additionally we have the bivector part is orthogonal to the reference direction.

The reverse transform becomes:

where $\eqref{rx1}$ is one way to reduce if we have all three values and $\eqref{rx2}$ is reworked for reconstructing from the orthogonal projection.

We can visualize the forward transform as operations on a globe in its original space. The north pole $\mathbf{z}$ is the fixed point. We poke a hole at the south pole $-\mathbf{z}$ (breaking it into an infinite number of copies) and pull it to the equator which now contains the infinite copies of it. All other points on the sphere remain on the same longitude and the angle measure of each with respect to $\mathbf{z}$ is halved.

If we are projecting into the disc, then we view this global looking straight at the north pole using an orthographic projection. This disc projection is an area-preserving map.

  • the north pole is mapped to $\left( 0, ~0 \right) $
  • positive half sphere $\left( \mathbf{z} \geq 0 \right) $ is mapped to the disc: $r \in \left[ 0, ~\frac{1}{\sqrt{2}} \right] $
  • negative half sphere $\left( \mathbf{z} < 0 \right )$ is mapped to the annulus: $r \in \left( \frac{1}{\sqrt{2}}, ~1 \right) $
  • the south pole is mapped to the unit circle.

Complex maps in 3D

If we have some (quaternion valued) complex function $f$ which we wish to apply in three dimensional space where $a$ behaves as the line-of-reals in complex numbers, then this can be expressed as2:

The action of $f$ is in the plane that spans $\mathbf{a}$, $\mathbf{b}$ and the origin so it acts as a surface of revolution about $\mathbf{a}$.

Using this and if we think of $\eqref{xform}$ as being a half angle transform, then it can be directly expressed in 3D as:

Likewise the reverse transform becomes double the angle of $\mathbf{p}$ with respect to $\mathbf{a}$:

Sphere to disc and back again

Taking $\eqref{xform3d}$ and performing the projection we can directly express the transform from unit sphere to unit disc ($\mathbb{S}^2 \rightarrow \mathbb{D} $) as:

The reverse transform from unit disc to unit sphere ($\mathbb{D} \rightarrow \mathbb{S}^2$):

If we are only interested in say mapping the postive half sphere to the unit disc we can multiply through by $\sqrt{2}$:

and we reverse this version by3:

This additional uniform scaling is still an area-preserving map.

The Lambert projection connection the azimuthal equal-area one

Using $ \eqref{xform3d} $ followed by an orthogonal projection in direction $b$ the result is a Lambert azimuthal equal-area projection4. The example given on wikipedia is:

The standard formulation of Lambert’s maps a unit sphere to a disc with a radius of two. The quaternion formulation above maps to the unit disc. Setting $\mathbf{b}=-\mathbf{z}$ and multiplying by two gives:

Applying the orthogonal projection and rewriting as a map yields:

Graphically this projection was originally formulated as this figure:


which is the arc with center $(0,-1)$ from the surface to the plane. The radius of the arc is $\sqrt{ \left( cos \left( \theta \right)-1\right)^2+\sin\left(\theta\right)^2}$. Divided by two and reducing yields $\sin\left(\frac{\theta}{2}\right)$

Conformal map sphere to plane/half-sphere to disc

If we take our original relative quaternion ($ \mathbf{nz}^* $), apply the Cayley transform1 and follow through the derivation then we get a stereographic projection of the sphere (south-pole and plane through the equator in this case). Since the general case equations are already in the half-angle/Cayely post I’ll simply note the dropped formalism versions:

  • the north pole is mapped to $\left( 0, ~0 \right) $
  • positive half sphere $\left( \mathbf{z} > 0 \right) $ is mapped to the unit disc
  • the equator is mapped to the unit circle
  • negative half sphere $\left( \mathbf{z} < 0 \right )$ is the plane outside of the unit circle

This is a conformal mapping between our original points on $\mathbb{S}^2$ to $\mathbb{R}^2$. However if we want the conformal mapping in terms of the rotational space we would instead apply the Cayley transform to $\eqref{fx}$.

Breusing harmonic mean yet another sphere to disc and back

If we take our forward transform $\eqref{xform3d}$ followed by the Cayley transform we have a map which is conformal for the rotational space $\mathbb{S}^3$, but is neither area-preserving nor conformal in terms of the points on $\mathbb{S}^2$. The common name of this projection is Breusing harmonic mean. To form this projection in $\mathbb{S}^3$ it becomes an added half-angle transform followed by Cayley.

Closing remarks

I could continue with some standard projections restated in quaternions. Wiechel becomes a half-angle and a rotation about $\mathbf{z}$ (which is a simply a complex product), but although reworking standard projections might have some utility it is not my intended point for this post. I intended to show the simple ability to convert a normal (unit bivector) to an implied form and transforming a complex map to standard 3D space. The convering of standard map projections is intended to give some insight into how these transforms behave in $\mathbb{S}^3$.


The following images are naive projections from the disc back to the sphere and half-sphere. They have 6-bits for each of $x$ and $y$ in the plane, so 4096 possible representations. However there is no biasing and I’m simply tossing away values outside of the disc dropping the number to 3207. The intent is to given another view on how density varies with respect to angle and max angle reduction and not to demonstrate practical quantization methods. See the density functions1 and notice that the “complex planes” in the top and bottom views are all lines through the center of the images.

Two full sphere projections showing top, side and bottom. Half-angle (Lamberts) and Breusing for $\mathbb{S}^2$:

LambertS2 BreusingS2

Since Breusing on the full-sphere has the highest density in the “opposite” direction of reference, reformulation in terms of $-\mathbf{b}$ could be interesting in some usages.

Now a sequence of half-spheres projections showing top and side. Simple reconstruction of $z = \sqrt{1-x^2-y^2}$, Half-angle (Lamberts), Cayley (conformal) and Breusing:

SimpleHS LambertHS CayleyHS BreusingHS

References and Footnotes

  1. Quaternion half/double angle and Cayley transforms (local post 2 3

  2. This can also be expressed as: since the product generally doesn’t commute. 

  3. Uniform points on disc, circle and sphere (local post

  4. Lambert azimuthal equal-area projection wikipedia