The quaternion algebra \(\mathbb{H}\) is a useful way to describe the Möbius and spherical geometry in three- and four-dimensions. In this note, I explain how the quaternionic product of edge vectors of a triangulated surface produces the tangents and normals of certain Möbius invariantly defined circles and spheres associated with the mesh. To avoid algebraic computations, we will interpret the quaternionic product as a rotation associated to a natural connection mapping unit vectors at one vertex to another where the monodromy can be computed from straightforward geometric considerations. At the end, I also describe when the product of four purely imaginary quaternions is real.
Consider a simplicial surface \(M = (V,E,F)\) with vertex set \(V\), edge set \(E\), and face set \(F\). Also, consider an assignment of vertex positions \(f : V\to \mathbb{R}^3\). The restriction to simplicial surfaces is only for simplicity and while the construction generalizes to more general cellular decompositions of surfaces, the interpretation of the product of edge vectors around a face will change.
For each vertex \(i\in V\), we consider the sphere of unit vectors in the ambient space based at \(f_i\) and denote it \(S^2_i\). This defines a 2-sphere bundle over the vertices of \(M\) that is equal to the pullback of the unit sphere bundle of \(T\mathbb{R}^3\) via \(f\). Consider the following \(\mathrm{SO}(3)\)-valued discrete connection over this bundle: for each oriented edge \(ij\), define \[\rho_{ij} : S^2_i \to S^2_j\] as the map that takes a unit vector \(N \in S^2_i\) to the tangent vector of the circle \(C_{ij}(N)\) at the point \(f_j\), where \(C_{ij}(N)\) is the unique circle that goes through \(f_i,f_j\) and that has tangent vector \(N\) at the point \(f_i\).
Obviously, the tangent \(\rho_{ij}(N)\) lies in the plane of the circle, and if we restrict our view to this plane we can see that the (planar) angle that \(\rho_{ij}(N)\) makes with the edge vector \(df_{ij}\) is the same as the angle it makes with \(N\).
Therefore, \(\rho_{ij}(N)\) can also be obtained by rotating \(N\) about the edge vector by \(180^\circ\), which also shows that \(\rho_{ij}\) is a rotation, as claimed above. This reflection about the edge vector can be described efficiently using quaternions, and provides the link between this geometric construction and quaternionic products of edge vectors:

Now that we have defined this connection, let us see how we can use it to compute geometric quantities with simplicity. For the first example, let us consider the monodromy of \(\rho\) around a single triangle \(ijk\in F\). Define \[R_{ijk} = \rho_{ki} \circ\rho_{jk} \circ\rho_{ij} : S^2_i\to S^2_i.\] For any triangle, there is a unique circle going through the three points, and the construction of \(\rho\) implies that \(R_{ijk}\) fixes the tangent \(t_{i}^{jk}\) of this circumcircle at \(i\), from which we conclude that it is a rotation about \(t_i^{jk}\). To determine the full rotation, we also need to know how it transforms any other vector \(v\) orthogonal to \(t_i^{jk}\). It is straightforward to see that \[R_{ijk}(v) = -v\] for any \(v\perp t_i^{jk}\). This shows that the rotation angle is equal to \(180^\circ\). On the other hand, using the quaternionic description of \(\rho\) we see that \[R_{ijk}(N) = (df_{ki} df_{jk} df_{ij}) N (df_{ki} df_{jk} df_{ij})^{-1}\] from which we see that the product of the edge vectors is purely imaginary and that \[t_i^{jk} = \pm e_{ki} e_{jk} e_{ij} = \mp \overline{e_{ki}e_{jk}e_{ij}} = \pm e_{ij} e_{jk} e_{ki}.\]
Here \[ e_{ij} = \frac{df_{ij}}{|df_{ij}|}.\] It does turn out that it is equal with factor \(+1\) but the argument above just shows this up to sign.
Just from the monodromy around a triangle, we can figure out the monodromy around the boundary of two triangles \(ijk,jil\in F\) sharing an edge \(ij\). That being said, it is also illustrative to use \(\rho\) to determine this monodromy directly since we will see the geometry of a circumsphere of four points arise. Define the monodromy
\[ R_{ij} := \rho_{ki}\circ\rho_{jk}\circ\rho_{lj}\circ \rho_{il}:S^2_i \to S^2_i. \] The four points \(f_i,f_j,f_k,f_l\in\mathbb{R}^3\) define a unique circumsphere that we will denote \(S_{ij}\). Recall that for any two points on a sphere there is a unique circle orthogonal to the sphere through the two points. This implies that \(R_{ij}\) fixes \(n_{ij}^i\), the normal of \(S_{ij}\) at the point \(f_i\) since \[ R_{ij}(n_{ij}^i) = (\rho_{ki} \circ \rho_{jk}\circ \rho_{lj})(-n_{ij}^l) = (\rho_{ki} \circ \rho_{jk})(n_{ij}^j) = \rho_{ki}(-n_{ij}^k) = n_{ij}^i\] On the other hand, using the quaternion representation we have that \[ R_{ij}(N) = (df_{il}df_{lj}df_{jk}df_{ki})\, N\, (df_{il}df_{lj}df_{jk}df_{ki})^{-1}. \] This shows that the imaginary component of the quaternionic cross ratio points in the direction of \(n_{ij}^i\). To determine the angle of rotation, we need to know how it acts on another vector orthogonal to \(n_{ij}^i\). The natural choice to check is the tangent of the circumcircle \(C_{ilj}\) at the point \(f_i\). From which we find that the rotation angle is given by the circumcircle intersection angle \(\beta_{ij}\), and so we have shown that \[e_{il}e_{lj}e_{jk}e_{ki} = \pm \exp\big(\frac{\beta_{ij}}{2}n_{ij}^i\big).\]
Circular Meshes and Reflections
In the case of a quad graph that is also a circle pattern, the connection we defined above is actually flat. Just look at the monodromy around a circular quad: it clearly fixes the tangent of the circle (this is true for the monodromy around any circular polygon), and for any vector orthogonal to the tangent, we follow the tangents of the edges of the ideal hyperbolic polygon defined by the points and the initial tangent (inside the sphere defined by the circle and the initial vector) and since there are four points the monodromy is the identity (1 = 5 in the left side of the figure below). The monodromy is trivial for any even number of vertices in the polygon, and otherwise it is a rotation about the tangent (like it was for triangle meshes; 1 = – 4 in the right side of the figure below):

There is another interpretation of the same connection that Niklas Affolter pointed out to me. The connection is the negative of the reflection about the perpendicular bisector plane between the two points. The monodromy of the connection defined byt he reflection can be computed by similar geometric considerations:
Products of Four Vectors
A related question is to understand the geometric configurations related to the product of four arbitrary imaginary quaternions (they do not need to be the edge vectors of a closed polygon). Let \[ p_1, p_2, p_3, p_4\in \operatorname{Im}\mathbb{H}, \] and consider the product \[ q := p_1 p_2 p_3 p_4. \] We want to understand when \(q\) is real. Using the fact that for imaginary quaternions \(a,b\in\operatorname{Im}\mathbb{H}\cong\mathbb{R}^3\) that \(ab = -a\cdot b + a\times b\) we find that \begin{align*} q & = ((p_1\cdot p_2)(p_3\cdot p_4) – (p_1\times p_2)\cdot(p_3\times p_4)) \\ & \qquad -(p_1\cdot p_2)p_3\times p_4 -(p_3\cdot p_4) p_1\times p_2 + (p_1\times p_2)\times (p_3\times p_4), \end{align*}
The imaginary component is in the span of \[\mathcal{B} = \{ p_1\times p_2, p_3\times p_4, (p_1\times p_2)\times (p_3\times p_4)\}.\] If \((p_1\times p_2)\times (p_3\times p_4)\) is non-zero then \(\mathcal{B}\) is a basis of \(\mathbb{R}^3\) and in this case it is impossible for \(\operatorname{Im}q = 0\) since it has a non-zero coefficient in front of \((p_1\times p_2)\times (p_3\times p_4)\). Therefore, if \(q\) is real then \(p_1,p_2,p_3,p_4\) all lie on the same plane through the origin. Without loss of generality, we can rotate our configuration so that these points all lie in the \(jk\)-plane: this is achieved by conjugation by a unit quaterion \(x\mapsto \overline{\psi} x\psi\) for some \(\psi\in S^3\) since this changes \(q\) into \(\overline{\psi} q\psi\) which is real if and only if \(q\) is.
After this normalization to the \(jk\)-plane, we can express \[p_\alpha = \ell_{\alpha}\exp(i\theta_\alpha)j\] for some angles \(\theta_\alpha\in \mathbb{R}\) and lengths \(l_{\alpha}\in\mathbb{R}\), \(\alpha\in\{1,2,3,4\}\). This allows us to compute \(q\) by a direct computation \[ q = (\ell_1\ell_2\ell_3\ell_4)(e^{i\theta_1}je^{i\theta_2}je^{i\theta_3}je^{i\theta_4}j) = (\ell_1\ell_2\ell_3\ell_4)e^{i(\theta_1 – \theta_2 + \theta_3 – \theta_3)}.\] This is real if and only if \(\theta_1 – \theta_2 + \theta_3 – \theta_4\in \pi\mathbb{Z}\), or said geometrically when the sum of the oriented angles between (1) the line spanned by \(p_1\) and the line spanned by \(p_2\) and (2) the line spanned by \(p_3\) and the line spanned by \(p_4\) sum up to a multiple of \(\pi\). By possibly shifting \(\theta_\alpha\) by \(2\pi\) we can always assume that this sum is either \(0\) or \(\pi\) and that the angles are in \([-\pi,\pi]\).
