# Difference between revisions of "Motor"

A motor is an operator that performs a proper isometry in Euclidean space. Such isometries encompass all possible combinations of any number of rotations and translations. The name motor is a portmanteau of motion operator or moment vector.

In the 4D projective geometric algebra $$\mathcal G_{3,0,1}$$, a motor $$\mathbf Q$$ has the general form

$$\mathbf Q = r_x \mathbf e_{41} + r_y \mathbf e_{42} + r_z \mathbf e_{43} + r_w {\large\unicode{x1d7d9}} + u_x \mathbf e_{23} + u_y \mathbf e_{31} + u_z \mathbf e_{12} + u_w$$ .

To possess the geometric property, the components of $$\mathbf Q$$ must satisfy the equation

$$r_x u_x + r_y u_y + r_z u_z + r_w u_w = 0$$ .

Motors are capable of representing any general screw motion consisting of a rotation about a line combined with a displacement along the same line. By Chasles’ theorem, all rigid motions in 3D space are screw motions.

An element $$\mathbf a$$ is transformed by a motor $$\mathbf Q$$ through the sandwich product $$\mathbf a' = \mathbf Q \mathbin{\unicode{x27C7}} \mathbf a \mathbin{\unicode{x27C7}} \mathbf{\underset{\Large\unicode{x7E}}{Q}}$$, where $$\unicode{x27C7}$$ is the geometric antiproduct.

## Simple Motors

If $$u_w = 0$$ (i.e., the scalar part $$Q_{\mathbf 1}$$ is zero), then the motor $$\mathbf Q$$ is called a simple motor. Every simple motor represents either a pure translation or a pure rotation about a line without any displacement along that line.

In the case of a pure translation, the motor $$\mathbf T$$ is given by

$$\mathbf T = t_x \mathbf e_{23} + t_y \mathbf e_{31} + t_z \mathbf e_{12} + {\large\unicode{x1d7d9}}$$ ,

and this performs a translation by twice the displacement vector $$(t_x, t_y, t_z)$$.

In the case of a pure rotation, the motor $$\mathbf R$$ is given by

$$\mathbf R = \mathbf L\sin\phi + {\large\unicode{x1d7d9}}\cos\phi$$ ,

and this performs a rotation by twice the angle $$\phi$$ about the line $$\mathbf L$$.

## Motors Built from Geometry

Motors having specific geometric constructions can be built from points, lines, and planes as shown in the following table.

Motor Description
$$\begin{split}\mathbf g \mathbin{\unicode{x27C7}} \mathbf f =\, &(f_yg_z - f_zg_y)\mathbf e_{41} + (f_zg_x - f_xg_z)\mathbf e_{42} + (f_xg_y - f_yg_x)\mathbf e_{43} \\ +\, &(g_xf_w - f_xg_w)\mathbf e_{23} + (g_yf_w - f_yg_w)\mathbf e_{31} + (g_zf_w - f_zg_w)\mathbf e_{12} \\ +\, &(f_xg_x + f_yg_y + f_zg_z)\smash{\large\unicode{x1d7d9}}\end{split}$$ Rotation about the line where planes $$\mathbf f$$ and $$\mathbf g$$ intersect by twice the angle between them in the direction from $$\mathbf f$$ to $$\mathbf g$$.

$$\mathbf f = f_x \mathbf e_{234} + f_y \mathbf e_{314} + f_z \mathbf e_{124} + f_w \mathbf e_{321}$$

$$\mathbf g = g_x \mathbf e_{234} + g_y \mathbf e_{314} + g_z \mathbf e_{124} + g_w \mathbf e_{321}$$

$$\begin{split}\mathbf L \mathbin{\unicode{x27C7}} \mathbf K =\, &(v_yw_z - v_zw_y)\mathbf e_{41} + (v_zw_x - v_xw_z)\mathbf e_{42} + (v_xw_y - v_yw_x)\mathbf e_{43} \\ +\, &(v_yn_z - v_zn_y + m_yw_z - m_zw_y)\mathbf e_{23} + (v_zn_x - v_xn_z + m_zw_x - m_xw_z)\mathbf e_{31} + (v_xn_y - v_yn_x + m_xw_y - m_yw_x)\mathbf e_{12} \\ -\, &(v_xn_x + v_yn_y + v_zn_z + m_xw_x + m_yw_y + m_zw_z) \\ -\, &(v_xw_x + v_yw_y + v_zw_z)\smash{\large\unicode{x1d7d9}}\end{split}$$ Rotation about the line containing the closest points on lines $$\mathbf K$$ and $$\mathbf L$$ by twice the angle between the directions $$\mathbf v$$ and $$\mathbf w$$, and translation by twice the distance between the lines in the direction from $$\mathbf K$$ to $$\mathbf L$$.

$$\mathbf K = w_x \mathbf e_{41} + w_y \mathbf e_{42} + w_z \mathbf e_{43} + n_x \mathbf e_{23} + n_y \mathbf e_{31} + n_z \mathbf e_{12}$$

$$\mathbf L = v_x \mathbf e_{41} + v_y \mathbf e_{42} + v_z \mathbf e_{43} + m_x \mathbf e_{23} + m_y \mathbf e_{31} + m_z \mathbf e_{12}$$

$$\mathbf q \mathbin{\unicode{x27C7}} \mathbf p = (p_xq_w - q_xp_w)\mathbf e_{23} + (p_yq_w - q_yp_w)\mathbf e_{31} + (p_zq_w - q_zp_w)\mathbf e_{12} - (p_wq_w)\smash{\large\unicode{x1d7d9}}$$ Translation by twice the distance between points $$\mathbf p$$ and $$\mathbf q$$ in the direction from $$\mathbf p$$ to $$\mathbf q$$.

$$\mathbf p = p_x \mathbf e_1 + p_y \mathbf e_2 + p_z \mathbf e_3 + p_w \mathbf e_4$$

$$\mathbf q = q_x \mathbf e_1 + q_y \mathbf e_2 + q_z \mathbf e_3 + q_w \mathbf e_4$$

## Norm

The bulk norm of a motor $$\mathbf Q$$ is given by

$$\left\Vert\mathbf Q\right\Vert_\unicode{x25CF} = \sqrt{\mathbf Q \mathbin{\unicode{x27D1}} \mathbf{\tilde Q}} = \sqrt{u_x^2 + u_y^2 + u_z^2 + u_w^2}$$ ,

and its weight norm is given by

$$\left\Vert\mathbf Q\right\Vert_\unicode{x25CB} = \sqrt{\mathbf Q \mathbin{\unicode{x27C7}} \smash{\mathbf{\underset{\Large\unicode{x7E}}{Q}}}\vphantom{\mathbf{\tilde Q}}} = {\large\unicode{x1D7D9}}\sqrt{r_x^2 + r_y^2 + r_z^2 + r_w^2}$$ .

The geometric norm of a motor $$\mathbf Q$$ is thus

$$\left\Vert\mathbf Q\right\Vert = \sqrt{\dfrac{u_x^2 + u_y^2 + u_z^2 + u_w^2}{r_x^2 + r_y^2 + r_z^2 + r_w^2}}$$ ,

and this is equal to half the distance that the origin is moved by the operator.

A motor is unitized when $$r_x^2 + r_y^2 + r_z^2 + r_w^2 = 1$$.

## Exponential Form

A motor $$\mathbf Q$$ can be expressed as the exponential of a unitized line $$\mathbf L$$ multiplied by $$d + \phi{\large\unicode{x1D7D9}}$$, where $$\phi$$ is half the angle of rotation about the line $$\mathbf L$$, and $$d$$ is half the displacement distance along the line $$\mathbf L$$. The exponential form can be written as

$$\mathbf Q = \exp_\unicode{x27C7}((d + \phi{\large\unicode{x1D7D9}}) \mathbin{\unicode{x27C7}} \mathbf L) = \cos_\unicode{x27C7}(d + \phi{\large\unicode{x1D7D9}}) + \sin_\unicode{x27C7}(d + \phi{\large\unicode{x1D7D9}}) \mathbin{\unicode{x27C7}} \mathbf L$$ .

This expands to

$$\mathbf Q = \mathbf L\sin\phi + (d \mathbin{\unicode{x27C7}} \mathbf L)\cos\phi - d\sin\phi + {\large\unicode{x1D7D9}}\cos\phi$$ ,

and replacing the line $$\mathbf L$$ with its components gives us

$$\mathbf Q = (v_x \mathbf e_{41} + v_y \mathbf e_{42} + v_z \mathbf e_{43} + m_x \mathbf e_{23} + m_y \mathbf e_{31} + m_z \mathbf e_{12})\sin\phi + (dv_x \mathbf e_{23} + dv_y \mathbf e_{31} + dv_z \mathbf e_{12})\cos\phi - d\sin\phi + {\large\unicode{x1D7D9}}\cos\phi$$ .

A motor in exponential form is always unitized, and its geometric norm can be written as

$$\left\Vert\mathbf Q\right\Vert = \sqrt{d^2 + (m_x^2 + m_y^2 + m_z^2)\sin^2\phi}$$ .

## Logarithm

Given an arbitrary unitized motor $$\mathbf Q$$ with $$|r_w| < 1$$, the values of $$\mathbf L$$, $$d$$, and $$\phi$$ can be determined from the components of $$\mathbf Q$$, essentially taking the logarithm of a motor. First, the scalar and antiscalar terms satisfy the equations

$$u_w = - d\sin\phi$$
$$r_w = \cos\phi$$ .

Assuming that $$\phi > 0$$, we define $$s = \sin\phi = \sqrt{1 - r_w^2}$$. Then,

$$d = -\dfrac{u_w}{s}$$
$$\phi = \tan^{-1}\left(\dfrac{s}{r_w}\right)$$ .

If $$r_w = 0$$, then we assign $$\phi = \pi/2$$. If $$r_w < 0$$, then we can add $$\pi$$ to $$\phi$$ to make the angle positive, but this is not required.

The components of $$\mathbf L$$ are then given by

$$(v_x, v_y, v_z) = \dfrac{1}{s}(r_x, r_y, r_z)$$
$$(m_x, m_y, m_z) = \dfrac{1}{s}\left[(u_x, u_y, u_z) - dr_w(v_x, v_y, v_z)\right] = \dfrac{1}{s}\left[(u_x, u_y, u_z) + \dfrac{r_wu_w}{s^2}(r_x, r_y, r_z)\right]$$ .

In the special case that $$r_w = \pm 1$$, the motor must be a pure translation with $$d = 0$$, $$\phi = 0$$, and $$\mathbf (v_x, v_y, v_z) = (0, 0, 0)$$.

## Square Root

The square root of a quaternion can be calculated by summing with the identity and renormalizing. If we attempt to do the same thing with a motor $$\mathbf Q$$, we find that it works only under certain conditions. However, such a calculation does give us a starting point from which we can make a correction for the general case.

Using the exponential form of $$\mathbf Q$$, we first examine the weight norm of $$\mathbf Q + {\large\unicode{x1D7D9}}$$ and find that

$$\left\Vert\mathbf Q + \smash{\large\unicode{x1D7D9}}\right\Vert_\unicode{x25CB} = \sqrt{\sin^2\phi + (\cos\phi + 1)^2} = \sqrt{\vphantom{\sin^2\phi}2 + 2Q_\smash{\large\unicode{x1D7D9}}}$$ ,

where $$Q_{\large\unicode{x1D7D9}} = \cos\phi$$. Applying the trigonometric identity $$\cos^2(\phi/2) = (1 + \cos\phi)/2$$, we can rewrite this as

$$\left\Vert\mathbf Q + \smash{\large\unicode{x1D7D9}}\right\Vert_\unicode{x25CB} = 2\cos(\phi/2)$$ .

Applying several more trigonometric identities, we now observe

$$\dfrac{\mathbf Q + {\large\unicode{x1D7D9}}}{\left\Vert\mathbf Q + \smash{\large\unicode{x1D7D9}}\right\Vert_\unicode{x25CB}} = \dfrac{\mathbf Q + {\large\unicode{x1D7D9}}}{2\cos(\phi/2)} = \mathbf L\sin(\phi/2) + \left(\dfrac{d}{2} \mathbin{\unicode{x27C7}} \mathbf L\right)\cos(\phi/2) - \dfrac{d}{2}\sin(\phi/2) + {\large\unicode{x1D7D9}}\cos(\phi/2) - \left(\dfrac{d}{2} \mathbin{\unicode{x27C7}} \mathbf L\right)\sin(\phi/2)\tan(\phi/2) - \dfrac{d}{2}\sin(\phi/2)$$ .

The first four terms are exactly the square root of $$\mathbf Q$$ because the distance $$d$$ and angle $$\phi$$ have both been halved. But there are two additional terms that we need to eliminate. It just so happens that

$$\dfrac{\mathbf Q + {\large\unicode{x1D7D9}}}{\left\Vert\mathbf Q + \smash{\large\unicode{x1D7D9}}\right\Vert_\unicode{x25CB}} \mathbin{\unicode{x27C7}} \dfrac{d}{2}\tan(\phi/2) = \left(\dfrac{d}{2} \mathbin{\unicode{x27C7}} \mathbf L\right)\sin(\phi/2)\tan(\phi/2) + \dfrac{d}{2}\sin(\phi/2)$$ ,

which means that

$$\sqrt{\mathbf Q} = \dfrac{\mathbf Q + {\large\unicode{x1D7D9}}}{\sqrt{2 + 2Q_\smash{\large\unicode{x1D7D9}}}} \mathbin{\unicode{x27C7}} \left({\large\unicode{x1D7D9}} + \dfrac{d}{2}\tan(\phi/2)\right)$$ .

The scalar component of $$\mathbf Q$$ can be rewritten as $$Q_{\mathbf 1} = -d\sin\phi = -2d\sin(\phi/2)\cos(\phi/2)$$. Dividing this by $$2 + 2Q_{\large\unicode{x1D7D9}} = 4\cos^2(\phi/2)$$ yields

$$\dfrac{Q_\mathbf 1}{2 + 2Q_{\large\unicode{x1D7D9}}} = -\dfrac{d}{2}\tan(\phi/2)$$ .

The square root of a general motor $$\mathbf Q$$ is thus given by

$$\sqrt{\mathbf Q} = \dfrac{\mathbf Q + {\large\unicode{x1D7D9}}}{\sqrt{2 + 2Q_\smash{\large\unicode{x1D7D9}}}} \mathbin{\unicode{x27C7}} \left({\large\unicode{x1D7D9}} - \dfrac{Q_\mathbf 1}{2 + 2Q_{\large\unicode{x1D7D9}}}\right)$$ .

If $$\mathbf Q$$ is a simple motor, then $$Q_{\mathbf 1} = 0$$, and this reduces to

$$\sqrt{\mathbf Q} = \dfrac{\mathbf Q + {\large\unicode{x1D7D9}}}{\sqrt{2 + 2Q_\smash{\large\unicode{x1D7D9}}}} = \dfrac{\mathbf Q + {\large\unicode{x1D7D9}}}{\left\Vert\mathbf Q + \smash{\large\unicode{x1D7D9}}\right\Vert_\unicode{x25CB}}$$ .

## Factorization

Any unitized motor $$\mathbf Q$$ can be factored into the product of a motor $$\mathbf R = r_x \mathbf e_{41} + r_y \mathbf e_{42} + r_z \mathbf e_{43} + r_w {\large\unicode{x1D7D9}}$$ corresponding to a pure rotation about a line through the origin and a motor $$\mathbf T = {t_x \mathbf e_{23} + t_y \mathbf e_{31} + t_z \mathbf e_{12} + \large\unicode{x1d7d9}}$$ corresponding to a pure translation by calculating

$$\mathbf T = \mathbf Q \mathbin{\unicode{x27C7}} \mathbf{\underset{\Large\unicode{x7E}}{R}}$$ .

The motor $$\mathbf T$$ is then given by

$$\mathbf T = (r_yu_z - r_zu_y + u_xr_w - r_xu_w)\mathbf e_{23} + (r_zu_x - r_xu_z + u_yr_w - r_yu_w)\mathbf e_{31} + (r_xu_y - r_yu_x + u_zr_w - r_zu_w)\mathbf e_{12} + {\large\unicode{x1d7d9}}$$ .

The original motor $$\mathbf Q$$ can now be expressed as

$$\mathbf Q = \mathbf T \mathbin{\unicode{x27C7}} \mathbf R$$ ,

where both $$\mathbf R$$ and $$\mathbf T$$ are unitized simple motors.

## Conversion from Motor to Matrix

Given a specific unitized motor $$\mathbf Q$$, define the matrices

$$\mathbf A = \begin{bmatrix}1 - 2(r_y^2 + r_z^2) & 2r_xr_y & 2r_zr_x & 2(r_yu_z - r_zu_y) \\ 2r_xr_y & 1 - 2(r_z^2 + r_x^2) & 2r_yr_z & 2(r_zu_x - r_xu_z) \\ 2r_zr_x & 2r_yr_z & 1 - 2(r_x^2 + r_y^2) & 2(r_xu_y - r_yu_x) \\ 0 & 0 & 0 & 1\end{bmatrix}$$

and

$$\mathbf B = \begin{bmatrix}0 & -2r_zr_w & 2r_yr_w & 2(r_wu_x - r_xu_w) \\ 2r_zr_w & 0 & -2r_xr_w & 2(r_wu_y - r_yu_w) \\ -2r_yr_w & 2r_xr_w & 0 & 2(r_wu_z - r_zu_w) \\ 0 & 0 & 0 & 0\end{bmatrix}$$ .

Then the corresponding 4×4 matrix $$\mathbf M$$ that transforms a point $$\mathbf p$$, regarded as a column matrix, as $$\mathbf p' = \mathbf{Mp}$$ is given by

$$\mathbf M = \mathbf A + \mathbf B$$ .

The inverse of $$\mathbf M$$, which transforms a plane $$\mathbf f$$, regarded as a row matrix, as $$\mathbf f' = \mathbf{fM^{-1}}$$ is given by

$$\mathbf M^{-1} = \mathbf A - \mathbf B$$ .

## Conversion from Matrix to Motor

Let $$\mathbf M$$ be an orthogonal 4×4 matrix with determinant +1 having the form

$$\mathbf M = \begin{bmatrix} M_{00} & M_{01} & M_{02} & M_{03} \\ M_{10} & M_{11} & M_{12} & M_{13} \\ M_{20} & M_{21} & M_{22} & M_{23} \\ 0 & 0 & 0 & 1\end{bmatrix}$$ .

Then, by equating the entries of $$\mathbf M$$ to the entries of $$\mathbf A + \mathbf B$$ from above, we have the following four relationships based on the diagonal entries of $$\mathbf M$$:

$$M_{00} - M_{11} - M_{22} + 1 = 4r_x^2$$
$$M_{11} - M_{22} - M_{00} + 1 = 4r_y^2$$
$$M_{22} - M_{00} - M_{11} + 1 = 4r_z^2$$
$$M_{00} + M_{11} + M_{22} + 1 = 4(1 - r_x^2 - r_y^2 - r_z^2) = 4r_w^2$$

And we have the following six relationships based on the off-diagonal entries of $$\mathbf M$$:

$$M_{21} + M_{12} = 4r_yr_z$$
$$M_{02} + M_{20} = 4r_zr_x$$
$$M_{10} + M_{01} = 4r_xr_y$$
$$M_{21} - M_{12} = 4r_xr_w$$
$$M_{02} - M_{20} = 4r_yr_w$$
$$M_{10} - M_{01} = 4r_zr_w$$

If $$M_{00} + M_{11} + M_{22} \geq 0$$, then we calculate

$$r_w = \pm \dfrac{1}{2}\sqrt{M_{00} + M_{11} + M_{22} + 1}$$ ,

where either sign can be chosen. In this case, we know $$|r_w|$$ is at least $$1/2$$, so we can safely divide by $$4r_w$$ in the last three off-diagonal relationships above to solve for $$r_x$$, $$r_y$$, and $$r_z$$. Otherwise, if $$M_{00} + M_{11} + M_{22} < 0$$, then we select one of the first three diagonal relationships based on the largest diagonal entry $$M_{00}$$, $$M_{11}$$, or $$M_{22}$$. After calculating $$r_x$$, $$r_y$$, or $$r_z$$, we plug its value into two of the first three off-diagonal relationships to solve for the other two values of $$r_x$$, $$r_y$$, and $$r_z$$. Finally, we plug it into one of the last three off-diagonal relationships to solve for $$r_w$$.

Setting $$t_x = M_{03}$$, $$t_y = M_{13}$$, and $$t_z = M_{23}$$, the values of $$u_x$$, $$u_y$$, $$u_z$$, and $$u_w$$ are given by

$$u_x = \dfrac{1}{2}(r_wt_x + r_zt_y - r_yt_z)$$

$$u_y = \dfrac{1}{2}(r_wt_y + r_xt_z - r_zt_x)$$

$$u_z = \dfrac{1}{2}(r_wt_z + r_yt_x - r_xt_y)$$

$$u_w = \dfrac{1}{2}(-r_xt_x - r_yt_y - r_zt_z)$$ .

## Motor Transformations

Points, lines, and planes are transformed by a unitized motor $$\mathbf Q$$ as shown in the following table.

Type Transformation
Point

$$\mathbf p = p_x \mathbf e_1 + p_y \mathbf e_2 + p_z \mathbf e_3 + p_w \mathbf e_4$$

$$\begin{split}\mathbf Q \mathbin{\unicode{x27C7}} \mathbf p \mathbin{\unicode{x27C7}} \smash{\mathbf{\underset{\Large\unicode{x7E}}{Q}}} =\, &\left[(1 - 2(r_y^2 + r_z^2))p_x + 2(r_xr_y - r_zr_w)p_y + 2(r_zr_x + 2r_yr_w)p_z + 2(r_yu_z - r_zu_y + r_wu_x - r_xu_w)p_w\right]\mathbf e_1 \\ +\, &\left[(1 - 2(r_z^2 + r_x^2))p_y + 2(r_yr_z - r_xr_w)p_z + 2(r_xr_y + 2r_zr_w)p_x + 2(r_zu_x - r_xu_z + r_wu_y - r_yu_w)p_w\right]\mathbf e_2 \\ +\, &\left[(1 - 2(r_x^2 + r_y^2))p_z + 2(r_zr_x - r_yr_w)p_x + 2(r_yr_z + 2r_xr_w)p_y + 2(r_xu_y - r_yu_x + r_wu_z - r_zu_w)p_w\right]\mathbf e_3 \\ +\, &p_w\mathbf e_4\end{split}$$
Line

$$\begin{split}\mathbf L =\, &v_x \mathbf e_{41} + v_y \mathbf e_{42} + v_z \mathbf e_{43} \\ +\, &m_x \mathbf e_{23} + m_y \mathbf e_{31} + m_z \mathbf e_{12}\end{split}$$

$$\begin{split}\mathbf Q \mathbin{\unicode{x27C7}} \mathbf L \mathbin{\unicode{x27C7}} \smash{\mathbf{\underset{\Large\unicode{x7E}}{Q}}} =\, &\left[(1 - 2r_y^2 - 2r_z^2)v_x + 2(r_xr_y - r_zr_w)v_y + 2(r_zr_x + 2r_yr_w)v_z\right]\mathbf e_{41} \\ +\, &\left[(1 - 2r_z^2 - 2r_x^2)v_y + 2(r_yr_z - r_xr_w)v_z + 2(r_xr_y + 2r_zr_w)v_x\right]\mathbf e_{42} \\ +\, &\left[(1 - 2r_x^2 - 2r_y^2)v_z + 2(r_zr_x - r_yr_w)v_x + 2(r_yr_z + 2r_xr_w)v_y\right]\mathbf e_{43} \\ +\, &\left[-4(r_yu_y + r_zu_z)v_x + 2(r_yu_x + r_xu_y - r_zu_w - r_wu_z)v_y + 2(r_zu_x + r_xu_z + r_yu_w + r_wu_y)v_z + (1 - 2r_y^2 - 2r_z^2)m_x + 2(r_xr_y - r_zr_w)m_y + 2(r_zr_x + 2r_yr_w)m_z\right]\mathbf e_{23} \\ +\, &\left[-4(r_zu_z + r_xu_x)v_y + 2(r_zu_y + r_yu_z - r_xu_w - r_wu_x)v_z + 2(r_xu_y + r_yu_x + r_zu_w + r_wu_z)v_x + (1 - 2r_z^2 - 2r_x^2)m_y + 2(r_yr_z - r_xr_w)m_z + 2(r_xr_y + 2r_zr_w)m_x\right]\mathbf e_{31} \\ +\, &\left[-4(r_xu_x + r_yu_y)v_z + 2(r_xu_z + r_zu_x - r_yu_w - r_wu_y)v_x + 2(r_yu_z + r_zu_y + r_xu_w + r_wu_x)v_y + (1 - 2r_x^2 - 2r_y^2)m_z + 2(r_zr_x - r_yr_w)m_x + 2(r_yr_z + 2r_xr_w)m_y\right]\mathbf e_{12}\end{split}$$
Plane

$$\mathbf f = f_x \mathbf e_{234} + f_y \mathbf e_{314} + f_z \mathbf e_{124} + f_w \mathbf e_{321}$$

$$\begin{split}\mathbf Q \mathbin{\unicode{x27C7}} \mathbf f \mathbin{\unicode{x27C7}} \smash{\mathbf{\underset{\Large\unicode{x7E}}{Q}}} =\, &\left[(1 - 2r_y^2 - 2r_z^2)f_x + 2(r_xr_y - r_zr_w)f_y + 2(r_zr_x + r_yr_w)f_z\right]\mathbf e_{234} \\ +\, &\left[(1 - 2r_z^2 - 2r_x^2)f_y + 2(r_yr_z - r_xr_w)f_z + 2(r_xr_y + r_zr_w)f_x\right]\mathbf e_{314} \\ +\, &\left[(1 - 2r_x^2 - 2r_y^2)f_z + 2(r_zr_x - r_yr_w)f_x + 2(r_yr_z + r_xr_w)f_y\right]\mathbf e_{124} \\ +\, &\left[2(r_yu_z - r_zu_y + r_xu_w - r_wu_x)f_x + 2(r_zu_x - r_xu_z + r_yu_w - r_wu_y)f_y + 2(r_xu_y - r_yu_x + r_zu_w - r_wu_z)f_z + f_w\right]\mathbf e_{321}\end{split}$$