1 Introduction

In Clifford’s geometric algebra, it is convenient to describe rotations using elements of spin groups. Spin groups of arbitrary dimension are naturally realized in this algebra. Nowadays Clifford’s geometric algebra is widely used in physics, computer science, engineering, and other sciences.

Professor Hestenes presented the method of computing elements of spin group \(\mathrm{Spin}_+(1,3)\) in the case of dimension \(n=4\) in [8] (pp. 52–53). This method is mentioned in other papers and books (see, for example, [13], p. 130). We generalize this method to the case of arbitrary dimension \(n=p+q\) and all spin groups \(\mathrm{Spin}_+(p,q)\), \(\mathrm{Spin}(p,q)\), \(\mathrm{Pin}_+(p,q)\), \(\mathrm{Pin}_-(p,q)\), \(\mathrm{Pin}(p,q)\). We use the method of averaging in Clifford’s geometric algebra previously proposed by the author [17, 18] to do this.

There are other methods of calculation of elements of spin groups using exponentials and exterior exponentials of bivectors (see [4, 8, 9, 13, 14]). But all these methods work only in the cases of fixed dimensions, especially \(n=3\) or \(n=4\). In this paper, we present explicit formulas for the elements of spin groups, which work in the case of arbitrary n.

Note that some years ago we presented another method of computing elements of spin groups using generalized Pauli’s theorem. These results were presented at the conference AGACSE 2012 (La Rochelle, France, July 2012) and published in the Conference Proceedings in AACA [19]. In [19], we presented an algorithm (we had no explicit formulas) for computing elements of spin groups. In the new method presented in the current paper, using the method of averaging, we obtain explicit formulas for the elements of spin groups.

The paper is organized as follows. In Sect. 2, we discuss a formalism of Clifford’s geometric algebra and use it for the consideration of pseudo-orthogonal groups. We prove some auxiliary lemmas. In Sect. 3, we present a complete picture of five orthogonal groups and five corresponding spin groups in the case of arbitrary dimension. In Sect. 4, we discuss Hestenes method of computing elements of the group \(\mathrm{Spin}_+(1,3)\). In Sect. 5, we generalize this method for the case of arbitrary dimension using the method of averaging in Clifford’s geometric algebra. In Sect. 6, we present an explicit formula for computing rotors, which connect two different frames related by a rotation in geometric algebra of arbitrary dimension.

2 Clifford Algebras and Pseudo-Orthogonal Group

Let us consider the real Clifford algebra \({C}\!\ell _{p,q}\), \(p+q=n\), with the identity element e and the generators \(e_a\), \(a=1, \ldots , n\), satisfying

$$\begin{aligned} e_a e_b+e_b e_a=2\eta _{ab}e, \end{aligned}$$
(2.1)

where \(\eta =||\eta _{ab}||\) is the diagonal matrix with its first p entries equal to 1 and the last q entries equal to \(-1\) on the diagonal.

We use notation with ordered multi-indices A for the basis elements of the Clifford algebra \({C}\!\ell _{p,q}\):

$$\begin{aligned} e_A=e_{a_1 \ldots a_k},\quad 1\le a_1< \cdots < a_k \le n. \end{aligned}$$

We denote the length of multi-index A by |A|. In the case of the identity element e, we have empty multi-index ø  of length 0. We call the subspace of \({C}\!\ell _{p,q}\) of Clifford algebra elements, which are linear combinations of basis elements with multi-indices of length \(|A|=k\), the subspace of grade k and denote it by \({C}\!\ell ^k_{p,q}\). We denote the projection operator onto subspace of the grade k by \(\pi _k\). We denote inverses of generators by \(e^a:=\eta ^{ab}e_b=(e_a)^{-1}\), \(a=1, \ldots , n\), and inverses of basis elements by \(e^A=(e_A)^{-1}\). The frame \(e^a\), \(a=1, \ldots , n\) is often called reciprocal frame for the frame \(e_a\), \(a=1, \ldots , n\).

Even and odd subspaces we denote by \({C}\!\ell ^{(0)}_{p,q}\) and \({C}\!\ell ^{(1)}_{p,q}\). We have

$$\begin{aligned} {C}\!\ell _{p,q}=\bigoplus _{k=0}^n {C}\!\ell ^k_{p,q},\qquad {C}\!\ell ^{(0)}_{p,q}=\!\!\!\bigoplus _{k=0\!\!\mod 2}{C}\!\ell ^k_{p,q},\qquad {C}\!\ell ^{(1)}_{p,q}=\!\!\!\bigoplus _{k=1\!\!\mod 2}{C}\!\ell ^k_{p,q}. \end{aligned}$$

Let us consider the pseudo-orthogonal group \(\mathrm{O}(p,q)\), \(p+q=n\):

$$\begin{aligned} \mathrm{O}(p,q):=\{P\in \mathrm{Mat}(n,{{\mathbb {R}}}): P^\mathrm{T}\eta P=\eta \}. \end{aligned}$$
(2.2)

Denote by

$$\begin{aligned} p^A_B=p^{a_1 \ldots a_k}_{b_1 \ldots b_k},\qquad a_1< \cdots< a_k,\quad b_1< \cdots < b_k, \end{aligned}$$

the minors of the matrix \(P=||p^a_b||\). They are determinants of the submatrices formed by rows \(a_1\), ..., \(a_k\) and columns \(b_1\), ..., \(b_k\). In the particular case of multi-indices of length 1 (\(A=a\), \(B=b\)), the corresponding minor is just an element \(p^a_b\) of the matrix P. In the case of empty multi-indices A and B, the corresponding minor equals 1 by definition. We use Einstein summation convention for ordered multi-indices too.

We have the following simple fact.

Lemma 2.1

The set \(\beta _a:=p_a^b e_b\in {C}\!\ell _{p,q}\) satisfies the following conditions

$$\begin{aligned} \beta _a \beta _b +\beta _b \beta _a=2\eta _{ab}e \end{aligned}$$

if and only if

$$\begin{aligned} P=||p_a^b||\in \mathrm{O}(p,q)=\{P\in \mathrm{Mat}(n, {{\mathbb {R}}}): P^\mathrm{T}\eta P=\eta \}. \end{aligned}$$

Proof

We have

$$\begin{aligned} \beta _a \beta _b+\beta _b \beta _a=p_a^c p_b^d (e_c e_d+e_d e_c)=2 p_a^c p_b^d \eta _{cd}. \end{aligned}$$

This means that \(\beta _a \beta _b +\beta _b \beta _a=2\eta _{ab}e\) if and only if \(p_a^c p_b^d \eta _{cd}=\eta _{ab}\). From the last condition, we obtain the definition of \(\mathrm{O}(p,q)\) (2.2). \(\square \)

For

$$\begin{aligned} \beta _a:=p_a^b e_b,\quad P=||p_a^b||\in \mathrm{O}(p,q), \end{aligned}$$
(2.3)

let us consider the elements

$$\begin{aligned} \beta _A=\beta _{a_1 \ldots a_k}:=\beta _{a_1}\cdots \beta _{a_k},\qquad 1\le a_1< \cdots < a_k \le n. \end{aligned}$$
(2.4)

Lemma 2.2

For (2.3), we have

$$\begin{aligned} \beta _{a_1 \ldots a_k}=p_{a_1 \ldots a_k}^{b_1 \ldots b_k}e_{b_1 \ldots b_k}, \end{aligned}$$
(2.5)

where \(p_{a_1 \ldots a_k}^{b_1 \ldots b_k}\) are minors of the matrix \(P=||p_a^b||\in \mathrm{O}(p,q)\) and we have a sum over all ordered multi-indices \(b_1 \ldots b_k\) of length k in (2.5).

Using our notations, we can rewrite (2.5) in the following way

$$\begin{aligned} \beta _A=p_A^B e_B, \end{aligned}$$
(2.6)

where we have a sum over all ordered multi-indices B of the same length as the length of the multi-index A.

Proof

For \(k=1\), we have \(\beta _a=p_a^b e_b\) by the definition. For \(k=2\), we have

$$\begin{aligned} \beta _{a_1 a_2}= & {} \beta _{a_1} \beta _{a_2}=(p_{a_1}^1 e_1+\cdots +p_{a_1}^n e_n)(p_{a_2}^1 e_1+\cdots +p_{a_2}^n e_n)\\= & {} (p_{a_1}^{1} p_{a_2}^1 \eta _{11}+\cdots +p_{a_1}^n p_{a_2}^n \eta _{nn})e\\&+(p_{a_1}^1 p_{a_2}^2-p_{a_2}^1 p_{a_1}^2)e_{12}+\cdots +(p_{a_1}^{n-1} p_{a_2}^n-p_{a_2}^{n-1} p_{a_1}^n)e_{n-1 \, n}\\= & {} p_{a_1 a_2}^{12}e_{12}+\cdots + p_{a_1 a_2}^{n-1 \, n}e_{n-1\, n}=p_{a_1 a_2}^{b_1 b_2}e_{b_1 b_2}, \end{aligned}$$

where we use

$$\begin{aligned} p_{a_1}^{b}p_{a_2}^{b} \eta _{b b}=0,\qquad a_1<a_2,\qquad P=||p_a^b||\in \mathrm{O}(p,q). \end{aligned}$$
(2.7)

In the general case, the proof is by induction on k. Suppose that we have (2.5) for \(k=m-1\). Let us prove it for \(k=m\). We have

$$\begin{aligned} \beta _{a_1 \ldots a_m}=\beta _{a_1 \ldots a_{m-1}}\beta _{a_m}=(p_{a_1 \ldots a_{m-1}}^{c_1 \ldots c_{m-1}}e_{c_1 \ldots c_{m-1}})(p_{a_m}^{c}e_{c}). \end{aligned}$$
(2.8)

Multiplying two sums, we obtain the element of grade \(m-2\) (in the case \(c \in \{c_1, \ldots , c_{m-1}\}\)) and the element of grade m (in the case \(c \notin \{c_1, \ldots , c_{m-1}\}\)).

The corresponding element of grade \(m-2\) equals zero. Using (2.7) and Laplace expansion, we can prove it again by induction. We omit detailed proof because of its cumbersomeness.

The corresponding element of grade m equals \(p_{a_1 \ldots a_m}^{b_1 \ldots b_m}e_{b_1 \ldots b_m}\) because of the Laplace expansion along one column of the corresponding minor:

$$\begin{aligned} p_{a_1 \ldots a_m}^{b_1 \ldots b_m}=\sum _{j=1}^{m}(-1)^{m+j} p_{a_1 \ldots a_{m-1}}^{b_1 \ldots \check{b_j} \ldots b_{m}}p_{a_m}^{b_j}, \end{aligned}$$

where \(b_1 \ldots \check{b_j} \ldots b_{m}\) is the ordered multi-index of length \(m-1\), which is obtained from \(b_1 \ldots b_m\) by discarding \(b_j\). \(\square \)

Note that as particular case of (2.5) we get

$$\begin{aligned} \beta _{1\ldots n}=\det (P) e_{1\ldots n},\qquad \det P=\pm 1. \end{aligned}$$

The conditions \(\beta _{1\ldots n}=\pm e_{1\ldots n}\) mean that \(2^n\) elements \(\beta _A\) (2.4) are linearity independent and constitute a new basis of \({C}\!\ell _{p,q}\) (see pp. 289–290 in [21] or pp. 127–128 in [16]).

3 Complete Picture of Orthogonal and Spin Groups

For the convenience of the reader, we present a complete picture of five orthogonal groups and the corresponding five spin groups in the case of arbitrary dimension. For more details, see [20] and [3]. Often, only the group \(\mathrm{Spin}_+(p,q)\) is considered, but sometimes other spin groups are also required for different applications.

Lemma 3.1

For an arbitrary matrix \(P\in \mathrm{O}(p,q)\), we have

$$\begin{aligned} \det P=\pm 1,\quad |p^{1\ldots p}_{1\ldots p}|\ge 1,\quad |p^{p+1 \ldots ,n}_{p+1 \ldots n}|\ge 1,\quad p^{1\ldots p}_{1\ldots p}=\frac{p^{p+1 \ldots n}_{p+1\ldots n}}{\det P}, \end{aligned}$$
(3.1)

where \(p^{1\ldots p}_{1\ldots p}\) and \(p^{p+1 \ldots ,n}_{p+1 \ldots n}\) are the corresponding minors of the matrix P.

Proof

The first statement is trivial. For the matrix

$$\begin{aligned} P=\left( \begin{array}{cc} A_{p\times p} &{} B_{p \times q} \\ C_{q\times p} &{} D_{q \times q} \\ \end{array} \right) \in \mathrm{O}(p,q) \end{aligned}$$

with the blocks ABCD of corresponding sizes, we have

$$\begin{aligned} P^\mathrm{T}\eta P= & {} \eta ,\quad B^\mathrm{T}B-D^\mathrm{T}D=-\mathbf{1},\quad |\det (D)|=|p^{p+1 \ldots ,n}_{p+1 \ldots n}|\ge 1;\\ P \eta P^\mathrm{T}= & {} \eta ,\quad A A^\mathrm{T}- B B^\mathrm{T}=\mathbf{1},\quad |\det (A)|=|p^{1\ldots p}_{1\ldots p}|\ge 1. \end{aligned}$$

From \(\eta P^\mathrm{T}\eta = P^{-1}\) and the well-known formula for the minor of the inverse of a matrix (see, for example, [7], pp. 25–27), we obtain

$$\begin{aligned} p^{1\ldots p}_{1\ldots p}=(p^{-1})^{1\ldots p}_{1\ldots p}=\frac{p^{p+1 \ldots n}_{p+1\ldots n}}{\det P}, \end{aligned}$$

where \((p^{-1})^{1\ldots p}_{1\ldots p}\) is the corresponding minor of the matrix \(P^{-1}\). \(\square \)

The group \(\mathrm{O}(p,q)\) has the following subgroups:

$$\begin{aligned} \mathrm{O}_+(p,q):= & {} \{P\in \mathrm{O}(p,q): p^{1\ldots p}_{1\ldots p}\ge 1\},\\ \mathrm{O}_-(p,q):= & {} \{P\in \mathrm{O}(p,q): p^{p+1\ldots n}_{p+1\ldots n}\ge 1\},\\ \mathrm{SO}(p,q):= & {} \{P\in \mathrm{O}(p,q): \det P=1\},\\ \mathrm{SO}_+(p,q):= & {} \{P\in \mathrm{SO}(p,q): p^{1\ldots p}_{1\ldots p}\ge 1\}=\{P\in \mathrm{SO}(p,q): p^{p+1\ldots n}_{p+1\ldots n}\ge 1\}. \end{aligned}$$

For example, in the particular case of Minkowski space, we have Lorentz group \(\mathrm{O}(1,3)\), special (or proper) Lorentz group \(\mathrm{SO}(1,3)\), orthochronous (or time preserving) Lorentz group \(\mathrm{O}_+(1,3)\), orthochorous (or parity preserving) Lorentz group \(\mathrm{O}_-(1,3)\), special orthochronous Lorentz group \(\mathrm{SO}_+(1,3)\).

In Euclidean cases (\(p=0\) or \(q=0\)), we have only two orthogonal groups instead of five groups:

$$\begin{aligned} \mathrm{O}(n):= & {} \mathrm{O}(n,0)=\mathrm{O}_-(n,0)\cong \mathrm{O}(0,n)=\mathrm{O}_+(0,n),\\ \mathrm{SO}(n):= & {} \mathrm{SO}(n,0)=\mathrm{SO}_+(n,0)=\mathrm{O}_+(n,0)\\\cong & {} \mathrm{SO}(0,n)=\mathrm{SO}_+(0,n)=\mathrm{O}_-(0,n). \end{aligned}$$

We denote grade involution (main involution) in \({C}\!\ell _{p,q}\) by

$$\begin{aligned} {\widehat{U}}:=U|_{e_a\rightarrow -e_a},\qquad U\in {C}\!\ell _{p,q} \end{aligned}$$

and reversion (anti-involution) by

$$\begin{aligned} {\widetilde{U}}:=U|_{e_{a_1\ldots a_k}\rightarrow e_{a_k}\ldots e_{a_1}},\qquad U\in {C}\!\ell _{p,q}. \end{aligned}$$

Denote by \(M^\times \) the subset of invertible elements of any set M. Let us consider the Lipschitz group

$$\begin{aligned} \Gamma ^\pm _{p,q}:= & {} \{S\in {C}\!\ell ^{(0)\times }_{p,q}\cup {C}\!\ell ^{(1)\times }_{p,q}: S {C}\!\ell ^1_{p,q}S^{-1}\subset {C}\!\ell ^1_{p,q}\}\\= & {} \{v_1 \cdots v_k: v_1, \ldots , v_k \in {C}\!\ell ^{1\times }_{p,q}\} \end{aligned}$$

and its subgroup

$$\begin{aligned} \Gamma ^+_{p,q}:= & {} \{S\in {C}\!\ell ^{(0)\times }_{p,q}: S {C}\!\ell ^1_{p,q} S^{-1}\subset {C}\!\ell ^1_{p,q}\}\\= & {} \{v_1 \cdots v_{2k}: v_1, \ldots , v_{2k} \in {C}\!\ell ^{1\times }_{p,q}\}\subset \Gamma ^\pm _{p,q}. \end{aligned}$$

The following groups are called spin groups:

$$\begin{aligned} \mathrm{Pin}(p,q):= & {} \{ S\in \Gamma ^\pm _{p,q}: {\widetilde{S}} S=\pm e\}=\{ S\in \Gamma ^\pm _{p,q}: \widehat{{\widetilde{S}}} S=\pm e\},\nonumber \\ \mathrm{Pin}_+(p,q):= & {} \{S\in \Gamma ^\pm _{p,q}: \widehat{{\widetilde{S}}} S=+e\},\nonumber \\ \mathrm{Pin}_-(p,q):= & {} \{S\in \Gamma ^\pm _{p,q}: {\widetilde{S}} S=+e\},\nonumber \\ \mathrm{Spin}(p,q):= & {} \{S\in \Gamma ^+_{p,q}: {\widetilde{S}} S= \pm e\}= \{S\in \Gamma ^+_{p,q}: \widehat{{\widetilde{S}}} S= \pm e\},\nonumber \\ \mathrm{Spin}_+(p,q):= & {} \{S\in \Gamma ^+_{p,q}: {\widetilde{S}}S=+e\}=\{S\in \Gamma ^+_{p,q}: \widehat{{\widetilde{S}}} S=+e\}. \end{aligned}$$
(3.2)

Let us consider the twisted adjoint representation

$$\begin{aligned} \phi : {C}\!\ell ^\times _{p,q}\rightarrow \mathrm{End}{C}\!\ell _{p,q},\quad S \rightarrow \phi _S,\quad \phi _S U={\widehat{S}}US^{-1},\qquad U\in {C}\!\ell _{p,q}. \end{aligned}$$

The following homomorphisms are surjective with the kernel \(\{\pm 1\}\):

$$\begin{aligned}&\phi : \mathrm{Pin}(p,q) \rightarrow \mathrm{O}(p,q),\\&\phi : \mathrm{Spin}(p,q) \rightarrow \mathrm{SO}(p,q),\\&\phi : \mathrm{Spin}_+(p,q) \rightarrow \mathrm{SO}_+(p,q),\\&\phi : \mathrm{Pin}_+(p,q) \rightarrow \mathrm{O}_+(p,q),\\&\phi : \mathrm{Pin}_-(p,q) \rightarrow \mathrm{O}_-(p,q). \end{aligned}$$

It means that, for all \(P=||p^a_b||\in \mathrm{O}(p,q)\), there exist \(\pm S\in \mathrm{Pin}(p,q)\) such that

$$\begin{aligned} {\widehat{S}} e_a S^{-1}=p_a^b e_b \end{aligned}$$
(3.3)

and for the other groups similarly. The spin groups (3.2) are two-sheeted coverings of the corresponding orthogonal groups.

Our goal is to find out elements \(\pm S\in \mathrm{Pin}(p,q)\) for each \(P\in \mathrm{O}(p,q)\) in the case of arbitrary p and q using the relation (3.3).

4 Hestenes Method

Let us consider the method proposed by Hestenes [8] for the case of dimension \(n=4\), \({C}\!\ell _{1,3}\).

For each element \(P=||p^a_b||\in \mathrm{SO}_+(1,3)\), there exist two elements \(\pm S\in \mathrm{Spin}_+(1,3)\) such that

$$\begin{aligned} Se_a S^{-1}=p_a^b e_b,\qquad S^{-1}={\tilde{S}}. \end{aligned}$$
(4.1)

The elements \(\pm S\) can be found in the following way

$$\begin{aligned} S=\pm \frac{L}{\sqrt{{\widetilde{L}}L}},\quad L:=p^b_a e_b e^a. \end{aligned}$$
(4.2)

Let us discuss the plan of the proof of the formula (4.2). Multiplying both sides of the first Eq. (4.1) on the right by \(e^a=(e_a)^{-1}\), we obtain

$$\begin{aligned} S e_a S^{-1} e^a=p_a^b e_b e^a=:L. \end{aligned}$$
(4.3)

We have the following well-known formula (see [13, 15])

$$\begin{aligned} e_a \pi _k(S) e^a=(-1)^k (n-2k) \pi _k(S),\quad S\in {C}\!\ell _{p,q},\quad k=0, \ldots , n. \end{aligned}$$
(4.4)

We have \(S\in \mathrm{Spin}_+(1,3)\), so \(S=\pi _0(S)+\pi _2(S)+\pi _4(S)\). Using (4.4), we get from (4.3)

$$\begin{aligned} 4S(\pi _0(S^{-1})-\pi _4(S^{-1}))=L. \end{aligned}$$
(4.5)

Let us take reversion of both sides of (4.5). We get

$$\begin{aligned} 4(\pi _0(S^{-1})-\pi _4(S^{-1})){\widetilde{S}}={\widetilde{L}}. \end{aligned}$$
(4.6)

Multiplying both sides of (4.6) by both sides of (4.5) and using \({\widetilde{S}}S=e\), we obtain

$$\begin{aligned} (4(\pi _0(S^{-1})-\pi _4(S^{-1})))^2={\widetilde{L}}L. \end{aligned}$$
(4.7)

Both sides of this equation belong to \({C}\!\ell ^0_{1,3}\oplus {C}\!\ell ^4_{1,3}\cong {{\mathbb {C}}}\). Taking square root of both sides of (4.7), we get

$$\begin{aligned} 4(\pi _0(S^{-1})-\pi _4(S^{-1}))=\pm \sqrt{{\widetilde{L}}L}. \end{aligned}$$
(4.8)

Substituting (4.8) into (4.5), we obtain (4.2).

Note that this method works only in the case of dimension \(n=4\) for the matrices \(P=||p^a_b||\in \mathrm{SO}_+(1,3)\) with additional condition

$$\begin{aligned} L \ne 0. \end{aligned}$$
(4.9)

The condition (4.9) is equivalent to the condition

$$\begin{aligned} \pi _0(S)\ne 0 \quad \text{ or } \quad \pi _4(S)\ne 0 \end{aligned}$$

for the corresponding element \(S\in \mathrm{Spin}_+(1,3)\).

In the next section, we will generalize this method to the case of arbitrary \(n=p+q\). We will use some other operators instead of (4.4) to do this.

5 Generalization of Hestenes Method

We have the following new theorems.

Theorem 5.1

Let us consider the real Clifford algebra \({C}\!\ell _{p,q}\) with even \(n=p+q\). Let \(P\in \mathrm{SO}(p,q)\) be an orthogonal matrix such that

$$\begin{aligned} M:=\sum _{A, B}p^B_A e_B e^A\ne 0. \end{aligned}$$
(5.1)

Then we can find the elements \(\pm S\in \mathrm{Spin}(p,q)\) that correspond to \(P=||p^b_a||\in \mathrm{SO}(p,q)\) as two-sheeted covering \(S e_a S^{-1}=p_a^be_b\) in the following way:

$$\begin{aligned} S=\pm \frac{M}{\sqrt{\alpha \,{\widetilde{M}}M}}, \end{aligned}$$
(5.2)

where

$$\begin{aligned} {\widetilde{M}}M \in \mathrm{Cen}({C}\!\ell _{p,q})={C}\!\ell _{p,q}^0\cong {{\mathbb {R}}}\end{aligned}$$

and the sign

$$\begin{aligned} \alpha :=\mathrm{sign}(p^{1\ldots p}_{1\ldots p})e=\mathrm{sign}(p^{p+1 \ldots n}_{p+1 \ldots n})e={\widetilde{S}}{S}=\pm e \end{aligned}$$

depends on the component of the orthogonal group \(\mathrm{SO}(p,q)\) (or the corresponding component of the spin group \(\mathrm{Spin}(p,q)\)).

Theorem 5.2

Let us consider the real Clifford algebra \({C}\!\ell _{p,q}\) with odd \(n=p+q\). Let \(P\in \mathrm{O}(p,q)\) be an orthogonal matrix such that

$$\begin{aligned} M:=\sum _{A, B}(\det P)^{|A|}p^B_A e_B e^A\ne 0. \end{aligned}$$
(5.3)

Then we can find the elements \(\pm S\in \mathrm{Pin}(p,q)\) that correspond to \(P=||p^b_a||\in \mathrm{O}(p,q)\) as two-sheeted covering \({\widehat{S}} e_a S^{-1}=p_a^be_b\) in the following way:

$$\begin{aligned} S=\pm \frac{M}{\sqrt{\alpha \,{\widetilde{M}}M}}, \end{aligned}$$
(5.4)

where

$$\begin{aligned} {\widetilde{M}}M\in {C}\!\ell ^0_{p,q}\subset \mathrm{Cen}({C}\!\ell _{p,q})\cong \left\{ \begin{array}{ll} {{\mathbb {R}}}\oplus {{\mathbb {R}}}, &{} \hbox {if }p-q=1\mod 4;\\ {{\mathbb {C}}}, &{} \hbox { if}\ p-q=3 \mod 4 \end{array} \right. \end{aligned}$$

and the sign

$$\begin{aligned} \alpha :=\left\{ \begin{array}{ll} \mathrm{sign}(p^{p+1 \ldots n}_{p+1 \ldots n})e={\widetilde{S}}{S}=\pm e, &{} \hbox {if }n=1\mod 4;\\ \mathrm{sign}(p^{1\ldots p}_{1\ldots p})e=\widehat{{\widetilde{S}}}S=\pm e, &{} \hbox { if}\ n=3 \mod 4 \end{array} \right. \end{aligned}$$
(5.5)

depends on the component of the orthogonal group \(\mathrm{O}(p,q)\) (or the corresponding component of the group \(\mathrm{Pin}(p,q)\)).

The conditions (5.1) and (5.3) are equivalent to the condition \(\pi _{\mathrm{Cen}}(S)\ne 0\) for the corresponding element \(S\in \mathrm{Pin}(p,q)\), where \(\pi _{\mathrm{Cen}}\) is the projection onto the center of the Clifford algebra

$$\begin{aligned} \mathrm{Cen}({C}\!\ell _{p,q})=\{U\in {C}\!\ell _{p,q}: UV=VU \,\hbox {for all}\, V\in {C}\!\ell _{p,q}\}. \end{aligned}$$

Proof

In the proof of Theorems 5.1 and 5.2, we use Reynolds operators of Salingaros vee group (see [17])

$$\begin{aligned} F(U):=\frac{1}{2^n}e_A U e^A=\pi _{\mathrm{Cen}}(U),\qquad U\in {C}\!\ell _{p,q}. \end{aligned}$$
(5.6)

We have the following relation (3.3) between orthogonal matrix \(P=||p^b_a||\in \mathrm{O}(p,q)\) and the corresponding two elements of spin group \(\pm S\in \mathrm{Pin}(p,q)\). We can rewrite this relation in the following way

$$\begin{aligned} S e_a S^{-1}=(\det P) p_a^b e_b \end{aligned}$$
(5.7)

because of the relation between parity of the element of spin group and the determinant of the corresponding orthogonal matrix (see Sect. 3). Multiplying (5.7) by itself several times and using Lemma 2.2, we get

$$\begin{aligned} S e_A S^{-1}=(\det P)^{|A|}p_A^B e_B. \end{aligned}$$
(5.8)

Multiplying both sides of (5.8) on the right by \(e^A=(e_A)^{-1}\), we obtain

$$\begin{aligned} S e_A S^{-1} e^A=(\det P)^{|A|}p_A^B e_B e^A. \end{aligned}$$
(5.9)

Here we have a sum over multi-indices A, B of the same length \(|A|=|B|\). We denote the right side of (5.9) by

$$\begin{aligned} M:=\sum _{A, B} (\det P)^{|A|}p_A^B e_B e^A\in {C}\!\ell ^{(0)}_{p,q} \end{aligned}$$
(5.10)

and get

$$\begin{aligned} 2^n S\, \pi _{\mathrm{Cen}}(S^{-1})=M. \end{aligned}$$
(5.11)

Using \(M\in {C}\!\ell ^{(0)}_{p,q}\) and \(S\in {C}\!\ell ^{(0)}_{p,q}\cup {C}\!\ell ^{(1)}_{p,q}\), we get \(\pi _{\mathrm{Cen}}(S^{-1})\in {C}\!\ell ^{(0)}_{p,q}\cup {C}\!\ell ^{(1)}_{p,q}\). The condition \(M\ne 0\) is equivalent to the condition \(\pi _{\mathrm{Cen}}(S)\ne 0\) for the element \(S\in \mathrm{Pin}(p,q)\) because of (5.11) and these facts.

We have the following well-known fact (see, for example [13]) about the center of the Clifford algebra \({C}\!\ell _{p,q}\):

$$\begin{aligned} \mathrm{Cen}({C}\!\ell _{p,q})=\left\{ \begin{array}{ll} {C}\!\ell ^0_{p,q}=\{ue: u\in {{\mathbb {R}}}\}, &{} \hbox {if }n\hbox { is even;}\\ {C}\!\ell ^0_{p,q}\oplus {C}\!\ell ^n_{p,q}=\{ue+u_{1\ldots n}e_{1\ldots n}: u, u_{1\ldots n}\in {{\mathbb {R}}}\}, &{} \hbox {if }n\hbox { is odd.} \end{array} \right. \end{aligned}$$

We have

$$\begin{aligned} (e_{1 \ldots n})^2=(-1)^{\frac{n(n-1)}{2}+q}e=\left\{ \begin{array}{ll} e, &{} \hbox {if }p-q=1\mod 4;\\ -e, &{} \hbox {if }p-q=3\mod 4 \end{array} \right. \end{aligned}$$

and

$$\begin{aligned} \mathrm{Cen}({C}\!\ell _{p,q})\simeq \left\{ \begin{array}{ll} {{\mathbb {R}}}, &{} \hbox {if } n\hbox { is even;}\\ {{\mathbb {R}}}\oplus {{\mathbb {R}}}, &{} \hbox {if } p-q=1\mod 4;\\ {{\mathbb {C}}}, &{} \hbox {if }p-q=3 \mod 4.. \end{array} \right. \end{aligned}$$

Note that \({{\mathbb {R}}}\) and \({{\mathbb {C}}}\) are fields, but the set of double numbers (split-complex numbers) \({{\mathbb {R}}}\oplus {{\mathbb {R}}}\) is not a field. It is an associative commutative algebra of dimension 2 over real numbers and it has zero divisors.

Now let us consider the cases of even and odd n separately.

In the case of even n, we have \(\pi _{\mathrm{Cen}}(S^{-1})=\pi _0(S^{-1})\). Let us take reversion of both sides of (5.11). We obtain

$$\begin{aligned} 2^n \pi _{0}(S^{-1}) {\widetilde{S}}={\widetilde{M}}. \end{aligned}$$
(5.12)

Multiplying both sides of (5.12) by both sides of (5.11) we obtain

$$\begin{aligned} 2^n 2^n \pi _0(S^{-1}) ({\widetilde{S}}S) \pi _0(S^{-1})={\widetilde{M}} M. \end{aligned}$$
(5.13)

We have \(\alpha :={\widetilde{S}}S=\pm e\in {C}\!\ell ^0_{p,q}\) and get

$$\begin{aligned} (2^n \pi _0(S^{-1}) )^2=\alpha {\widetilde{M}} M. \end{aligned}$$
(5.14)

Taking square root and substituting this expression into (5.11), we get (5.2).

In the case of odd n, we have \(\pi _{\mathrm{Cen}}(S^{-1})=\pi _0(S^{-1})+\pi _n(S^{-1})\) and

$$\begin{aligned} \widetilde{e_{1\ldots n}}=(-1)^{\frac{n(n-1)}{2}}e_{1\ldots n}=\left\{ \begin{array}{ll} e_{1\ldots n}, &{} \hbox {if }n=1\mod 4;\\ -e_{1\ldots n}, &{} \text{ if } n=3\mod 4, \end{array} \right. \\ \widehat{\widetilde{e_{1\ldots n}}}=(-1)^{\frac{n(n-1)}{2}+n}e_{1\ldots n}=\left\{ \begin{array}{ll} e_{1\ldots n}, &{} \hbox {if }n=3\mod 4;\\ -e_{1\ldots n}, &{} \hbox {if }n=1\mod 4. \end{array} \right. \end{aligned}$$

In the case \(n=1\mod 4\), taking reversion of both sides of (5.11), we get

$$\begin{aligned} 2^n (\pi _{0}(S^{-1})+\pi _n(S^{-1})) {\widetilde{S}}={\widetilde{M}}. \end{aligned}$$
(5.15)

Multiplying both sides of (5.15) by both sides of (5.11), we obtain

$$\begin{aligned} 2^n 2^n (\pi _{0}(S^{-1})+\pi _n(S^{-1})) ({\widetilde{S}}S) (\pi _{0}(S^{-1})+\pi _n(S^{-1}))={\widetilde{M}} M. \end{aligned}$$
(5.16)

We have \(\alpha :={\widetilde{S}} S=\pm e\in {C}\!\ell ^0_{p,q}\) and get

$$\begin{aligned} (2^n (\pi _{0}(S^{-1})+\pi _n(S^{-1})) )^2=\alpha {\widetilde{M}} M. \end{aligned}$$
(5.17)

Taking square root and substituting this expression into (5.11), we get (5.4) for the first case (5.5).

In the case \(n=3\mod 4\), taking superposition of reversion and grade involution (it is called Clifford conjugation) of both sides of (5.11), we get

$$\begin{aligned} 2^n (\pi _{0}(S^{-1})+\pi _n(S^{-1})) \widehat{{\widetilde{S}}}=\widehat{{\widetilde{M}}}. \end{aligned}$$
(5.18)

Multiplying both sides of (5.18) by both sides of (5.11), we obtain

$$\begin{aligned} 2^n 2^n (\pi _{0}(S^{-1})+\pi _n(S^{-1})) ( \widehat{{\widetilde{S}}}S) (\pi _{0}(S^{-1})+\pi _n(S^{-1}))=\widehat{{\widetilde{M}}} M. \end{aligned}$$
(5.19)

We have \(\alpha :=\widehat{{\widetilde{S}}}S=\pm e\in {C}\!\ell ^0_{p,q}\) and get

$$\begin{aligned} (2^n (\pi _{0}(S^{-1})+\pi _n(S^{-1})) )^2=\alpha \widehat{{\widetilde{M}}} M. \end{aligned}$$
(5.20)

Taking square root and substituting this expression into (5.11), we get (5.4) for the second case (5.5).

The theorems are proved. \(\square \)

6 Calculation of Rotors in Geometric Algebra

Let us consider the particular case of Theorems 5.1 and 5.2 for the elements of the group \(\mathrm{Spin}_+(p,q)\) and the corresponding group \(\mathrm{SO}_+(p,q)\). Elements of \(\mathrm{Spin}_+(p,q)\) are often called rotors and have wide application in geometric algebra (see, for example, [2, 4,5,6, 8, 9, 12]). We obtain the following statement.

Corollary 6.1

Let we have

$$\begin{aligned} S e_a {\widetilde{S}}=\beta _a,\quad {\widetilde{S}}=S^{-1}, \end{aligned}$$

where two frames \(e_a\) and \(\beta _a\), \(a=1, \ldots , n\), are related by a rotation.

If

$$\begin{aligned} M=\beta _A e^A=e+\beta _a e^a +\cdots +\beta _{1\ldots n}e^{1\ldots n}\ne 0, \end{aligned}$$
(6.1)

then

$$\begin{aligned} S=\pm \frac{M}{\sqrt{{\widetilde{M}}M}}. \end{aligned}$$

Using our previous notation, we can write

$$\begin{aligned} \beta _a= & {} p_a^b e_b,\quad M=\beta _A e^A=p_A^B e_B e^A, \\ P= & {} ||p_a^b||\in \mathrm{SO}_+(p,q),\quad S\in \mathrm{Spin}_+(p,q). \end{aligned}$$

In the particular case of \(n=3\), we have

$$\begin{aligned} M=e+\beta _a e^a+\beta _{a_1 a_2}e^{a_1 a_2}+\beta _{123}e^{123}=2(e+ \beta _a e^a) \end{aligned}$$
(6.2)

because \(\beta _{123}=e_{123}\in \mathrm{Cen}({C}\!\ell _{p,q})\). We can remove scalar “2” in (6.2) because of normalization and finally obtain the following well-known formula for the rotor S (see, for example, p. 103 in [4] or p. 72 in [2])

$$\begin{aligned} M=e+\beta _a e^a,\qquad S=\pm \frac{M}{\sqrt{{\widetilde{M}}M}}. \end{aligned}$$
(6.3)

This formula is widely used in different applications of geometric algebra. Corollary 6.1 generalizes (6.3) to the case of arbitrary n.

The results of this paper were reported at the conference AGACSE 2018 (Campinas, Brazil, July 2018). We hope that these results will be useful for different applications in computer science, robotics, and engineering. There are well-known methods of calculating of rotors in dimensions \(n=3\) and 4, but we often need geometric algebra of higher dimensions. For example, the conformal geometric algebra \({C}\!\ell _{4,1}\) of dimension \(n=5\) is widely used in different applications (see, for example, [1, 6, 10, 11]). The results of this paper allow us to calculate rotors in arbitrary dimension \(n=p+q\ge 1\).