SSWING-TWIST DECOMPOSITION IN CLIFFORD ALGEBRA
PRZEMYS(cid:32)LAW DOBROWOLSKI
Abstract.
The swing-twist decomposition is a standard routine in motionplanning for humanoid limbs. In this paper the decomposition formulas arederived and discussed in terms of Clifford algebra. With the decomposition onecan express an arbitrary spinor as a product of a twist-free spinor and a swing-free spinor (or vice-versa) in 3-dimensional Euclidean space. It is shown that inthe derived decomposition formula the twist factor is a generalized projectionof a spinor onto a vector in Clifford algebra. As a practical application ofthe introduced theory an optimized decomposition algorithm is proposed. Itfavourably compares to existing swing-twist decomposition implementations. Introduction
Swing-twist decomposition of rotations is commonly used in context of humanoidmotion planning. Consider movement of an arm reaching some predefined position.In order to displace it properly, a controller calculates twist factor of the corre-sponding rotation. Having this factor computed, a controller is then able to applysome corrections to the motion so that the arm is not unnaturally twisted duringthe motion.
Swing-twist decomposition is an inherent part of a correction al-gorithm. It allows one to decompose an arbitrary rotation into a swing part (tiltof a given axis) and a twist part (rotation around a given axis). In this paper thedecomposition is derived and discussed in terms of Clifford algebra.Swing-twist decomposition has already been considered for a few decades. Differ-ent authors have obtained equivalent formulas, in particular for quaternion algebra.Current literature tends to neglect a deeper consideration on the spin-twist decom-position. There is wide range of publications on humanoid motion planning. Mostof these works relate to swing-twist decomposition in some way. In the paper, themost revelant approaches to swing-twist decomposition are quoted and compared.Starting from the recent PhD dissertation by Huyghe ([1], 2011), the swing-twistdecomposition is introduced in quaterion algebra by a proposed therein projectionoperator. Unfortunately, the origin of the projection operator is not enough ex-plained. In two previous papers, Baerlocher ([2], 2001) and Baerlocher, Boulic ([3],2000) investigate joint boundaries for ball-and-socket joints using swing-twist de-composition. Grassia ([4], 1998) discusses features of a swing-twist decompositionin terms of an exponential map . However, the author does not present any re-lated formula for the decomposition. A classic work by Korein ([5], 1984) containsmost of the initial results on body positioning and joint motion. Among othersthe work uses swing-twist decomposition of rotations to constrain movement of anelbow.None of these are generalized to Clifford or geometric algebras which has deeperconsequences than previous results. In this paper the swing-twist decomposition a r X i v : . [ c s . R O ] J un PRZEMYS(cid:32)LAW DOBROWOLSKI is derived as an inverse of a formula expressing the set of rotations which move agiven initial vector to cover a given terminal one.2.
Existing and related solutions
Swing-twist decomposition splits a given rotation in two parts: a swing part anda twist part. A schematic view of a limb rotating with a ball joint is presented infigure 1.
Figure 1.
A limb with a ball jointBy zero twist reference vector one refers to a base vector with respect towhich the swing-twist decomposition is performed. Usually, this is the bone of arotating limb.There are several existing approaches. These solutions differ in terms of perfor-mance, complexity and result exactness.2.1.
Direct method.
For quaternions one can make the following argument. Let q ∈ H be a quaternion and v be a zero-twist reference vector. In case of twist-after-swing type of decomposition (see section 6) the initial vector becomes the given v vector and the terminal vector is w = qvq ∗ . Schematic view is presented in figure2. Figure 2.
A direct decomposition of a quaternionSwing quaternion can be calculated with an axis angle representation of thequaternion. Here, the axis is a normalized vector perpendicular to v and w and theangle is equal to the angle between v and w so: n = v × w (cid:107) v × w (cid:107) cos( α ) = v · wq s = cos( α/
2) + sin( α/ n x i + n y j + n z k ) WING-TWIST DECOMPOSITION IN CLIFFORD ALGEBRA 3
Twist quaternion is calculated by the following inversion formula: q = q t q s = ⇒ q t = qq − s q t = q (cos( α/ − sin( α/ n x i + n y j + n z k ))In this formulation both trigonometric and inverse trigonometric functions areused. It is a practical disadvantage since it requires computationally expensivefunctions which can also face some accuracy issues.2.2. Huyghe’s method.
Huyghe uses swing-after-twist decomposition type. Firsta simplified formula is derived which is a decomposition of an arbitrary quaternion q into a product q = q s q t with respect to a constant Z-axis aligned zero-twist reference vector (called there”a twist axis”). With the following coordinates q = w + x i + y j + z k q t = w t + z t k q s = w s + x s i + y s j the author shows using some algebraic transformations that the decomposition is w t = ± w √ w + z z t = ± z √ w + z w s = w t w + z t zx s = w t x − z t yy s = w t y + z t x It must be noted that some of the results were not rigorously stated. It particular,scenarios when some coefficients are equal to zero are not discussed separately whichleads to possible division by zero.In the second part of the thesis, Huyghe derives a generalized formula for swing-twist decomposition. Assume that axis-angle representation of quaternions is q s = [ w s , v s ] = [cos( σ , u s sin( σ q t = [ w t , v t ] = [cos( τ , u t sin( τ q = q s q t = [ w s w t − v t · v s , w s v t + w t v s + v s × v t ]Huyghe notes that the axes v s and v t are perpendicular so formula (1) simplifies to(2) q = [ w s w t , w s v t + w t v s + v s × v t ]Next, the author introduces a new quaternion q p (no origin is provided) which is”a projected version of the initial quaternion q onto the twist axis” ([1]) q p = [ w, ( v · u t ) u t ]= [ w s w t , ( w s v t · u t + w t v s · u t + ( v s × v t ) · u t ) u t ]= [ w s w t , w s (cid:107) u t (cid:107) sin( τ u t ] PRZEMYS(cid:32)LAW DOBROWOLSKI = [ w s w t , w s v t ]Normalization of quaternion q p gives q p (cid:107) q p (cid:107) = [ w s w t , w s v t ] (cid:112) w s w t + w s (cid:107) v t (cid:107) = w s [ w t , v t ] w s (cid:112) w t + (cid:107) v t (cid:107) = q t which in result turns out to be twist quaternion. Note that in the above equationHuyghe does not consider w s = 0 which is a drawback. Remaining swing quaternionis calculated from q s = qq ∗ t which completes the decomposition.3. Preliminaries
The presented results relate to C (cid:96) := C (cid:96) , ( R ) - Clifford algebra of 3-dimensionalreal space. Herein, a spinor is given by s = a + b e + c e + d e ∈ Spin(3) and avector is given by v = x e + y e + z e . A rotation of a vector is given by Cliffordmultiplication: v (cid:48) = svs − for an arbitrary vector v and a spinor s .In this paper (cid:3) − denotes the inverse of a spinor. In case of Spin(3) it is equiv-alent to conjugation: s − = ˜ s = a − b e − c e − d e A spinor can be written as a sum of its scalar and bivector parts: s = [ s ] + [ s ] where [ s ] ∈ (cid:86) R and [ s ] ∈ (cid:86) R . In several places the Hodge star (cid:63) operatoris used. In an orthonormal basis it is defined as (cid:63) ( e ∧ e ∧ · · · ∧ e k ) = e k +1 ∧ e k +2 ∧ · · · ∧ e n but in this paper it is used only in relation to the bivector part of a spinor. In thiscase the formula can be simplified to: (cid:63) [ s ] = − e [ s ] ∈ (cid:94) R A convenient notation is used for normalized vectors. For a given non-zero vector v (cid:54) = 0, the normalization function is defined as:n( v ) = v (cid:107) v (cid:107) where (cid:107) v (cid:107) = √ v · v = √ vv is the length of vector v . Note that it is impossibleto define a normalized zero vector. Let s be a spinor and v be a vector in C (cid:96) .The rotation svs − of the vector v by the spinor s gives a rotated vector v (cid:48) = x (cid:48) e + y (cid:48) e + z (cid:48) e which is equal to: x (cid:48) = ( a − b + c − d ) x + 2 y ( ab + cd ) + 2 z ( bc − ad ) y (cid:48) = ( a − b − c + d ) y + 2 x ( cd − ab ) + 2 z ( bd + ac ) z (cid:48) = ( a + b − c − d ) z + 2 x ( bc + ad ) + 2 y ( bd − ac )(3)This paper if organized as follows: first we obtain the complete set of spinorswhich do not rotate a given non-zero vector. Next we derive a spinor which rotates WING-TWIST DECOMPOSITION IN CLIFFORD ALGEBRA 5 a given initial vector to cover a given terminal vector. By combining these twoformulas we derive a formula which represents an arbitrary rotation by initial andterminal vectors (swing factor) together with axis rotation (twist factor). Finallyswing-twist representation is inversed for an arbitrary rotation and a unique swing-twist decomposition of a spinor is obtained. In conclusion some applications of theproposed decomposition are presented.4.
The set of spinors which do not rotate a given vector
In this section we assume that v is a non-zero vector. The set of all spinors s ∈ Spin(3) which do not rotate the given vector v will be called an invariant setof spinors for a given vector. The following theorem will be proved: Proposition 1 (The set of spinors which do not rotate a given vector) . Let v bea non-zero vector in C (cid:96) . The complete set of spinors s such that svs − = v isdetermined by: s = exp( e α n( v )) for all α ∈ [0; 2 π ) . For a given element a ∈ C (cid:96) exponential of a is defined as: exp( a ) := ∞ (cid:88) k =0 a k k ! Proof.
The proof will use the coordinate expansion of spinor rotation formula andthe normalization identity giving the following set of equations: ( a − b + c − d − x + 2 y ( ab + cd ) + 2 z ( bc − ad ) = 0( a − b − c + d − y + 2 x ( cd − ab ) + 2 z ( bd + ac ) = 0( a + b − c − d − z + 2 x ( bc + ad ) + 2 y ( bd − ac ) = 0 a + b + c + d − Q i as the left side of i th equation of 4. A valid solution ( a, b, c, d ) mustsatisfy the following equation:(5) xQ + yQ + zQ − ( x + y + z ) Q = 0formula (5) can be expanded:( a − b + c − d − x + 2 xy ( ab + cd ) + 2 xz ( bc − ad )+ ( a − b − c + d − y + 2 xy ( cd − ab ) + 2 yz ( bd + ac )+ ( a + b − c − d − z + 2 xz ( bc + ad ) + 2 yz ( bd − ac ) − ( x + y + z )( a + b + c + d −
1) = 0( a − b + c − d − − a − b − c − d + 1) x + 2 xycd + 2 xzbc + ( a − b − c + d − − a − b − c − d + 1) y + 2 xycd + 2 yzbd + ( a + b − c − d − − a − b − c − d + 1) z + 2 xzbc + 2 yzbd = 0( b + d ) x + ( b + c ) y + ( c + d ) z − xycd − xzbc − yzbd = 0( bx − cz ) + ( dx − cy ) + ( by − dz ) = 0which implies that the three identities must hold:(6) bx = cz, dx = cy, by = dz PRZEMYS(cid:32)LAW DOBROWOLSKI
Next, identities (6) are plugged into the first equation of 4 and simplified using theidentity a + b + c + d = 1:2( a + c − x + 2 yab + 2 ycd + 2 zbc − zad = 02( a + c − x + 2 zad + 2 ycd + 2 zbc − zad = 0( a + c − x + ycd + zbc = 0When x (cid:54) = 0 there is ( a + c − x + ycd + zbc = 0( a + c − x + yc cyx + z czx c = 0( a + c − x + y c + z c = 0 c ( x + y + z ) = x (1 − a ) c = σx √ − a (cid:112) x + y + z (7)for σ ∈ {− , } . In the other case, when x = 0 is is easy to observe from (6) that cy = 0 , cz = 0plugging the above to (4): yab − zad = 0( a − b − c + d − y + 2 zbd = 0( a + b − c − d − z + 2 ybd = 0 a + b + c + d − by = dz : (cid:40) ( a − b − c + d − y + 2 b y = 0( a + b − c − d − z + 2 d z = 0(9) (cid:40) ( a + b − c + d − y = 0( a + b − c + d − z = 0(10)it is impossible that both y = 0 and z = 0 since in this case x = 0 and (cid:107) v (cid:107) (cid:54) = 0 byassumption. Hence, from any of the above equations there must be: a + b − c + d − a + b − c + d − − ( a + b + c + d −
1) = − c = 0(11) = ⇒ c = 0(12)which is also covered by the general solution (7) thus it can be assumed that (7)is the only solution. Remaining spinor components are derived as follows. When x (cid:54) = 0 one writes using identities (6): b = zx σx √ − a (cid:112) x + y + z = σz √ − a (cid:112) x + y + z (13) WING-TWIST DECOMPOSITION IN CLIFFORD ALGEBRA 7 d = yx σx √ − a (cid:112) x + y + z = σy √ − a (cid:112) x + y + z (14)in the case when x = 0 from (11) there is c = 0. To calculate b and d one rewrites(8): yab − zad = 0( a − b + d − y + 2 zbd = 0( a + b − d − z + 2 ybd = 0 a + b + d − y (cid:54) = 0 then from (6) there is b = zy d . Plugging this identity intothe fourth equation of (15) one obtains: a − z y + 1) d = 0( a − y + ( x + y + z ) d = 0 d = σy √ − a (cid:112) x + y + z and from b = zy d there is: b = zy σy √ − a (cid:112) x + y + z = σz √ − a (cid:112) x + y + z In the case when y = 0 there must be z (cid:54) = 0 since (cid:107) v (cid:107) (cid:54) = 0. Thus, from (6) there is d = yz b . Plugging this identity into the fourth equation of (15) one obtains: a − y z + 1) b = 0( a − z + ( x + y + z ) b = 0 b = σz √ − a (cid:112) x + y + z and from b = zy d there is: d = yz σz √ − a (cid:112) x + y + z = σy √ − a (cid:112) x + y + z In all cases a general solution to (4) in coordinates is: a ∈ [ −
1; 1] , σ ∈ {− , } (16) b = σz √ − a (cid:112) x + y + z , c = σx √ − a (cid:112) x + y + z , d = σy √ − a (cid:112) x + y + z (17)There are two parametrized solutions to the set of equations (4): s = a + σz √ − a (cid:112) x + y + z e + σx √ − a (cid:112) x + y + z e + σy √ − a (cid:112) x + y + z e
31 PRZEMYS(cid:32)LAW DOBROWOLSKI s = a + σ √ − a (cid:112) x + y + z ( ze + xe + ye ) s = a + σ √ − a (cid:112) x + y + z e ( ze + xe + ye ) s = a + σ √ − a (cid:107) v (cid:107) e vs = a + σ e (cid:112) − a n( v )Finally, since many of the operations were reductions, all solutions are plugged intothe original set of equations to check their validity. It can be seen that: svs − = ( a + σ e (cid:112) − a n( v )) v ( a + σ e (cid:112) − a n( v )) − = ( a + σ e (cid:112) − a n( v )) v ( a − σ e (cid:112) − a n( v ))= ( av + σ e (cid:112) − a n( v ) v )( a − σ e (cid:112) − a n( v ))= ( av + σ e (cid:112) − a (cid:107) v (cid:107) )( a − σ e (cid:112) − a n( v ))= ava + av ( − σ e (cid:112) − a n( v )) + ( σ e (cid:112) − a (cid:107) v (cid:107) ) a +( σ e (cid:112) − a (cid:107) v (cid:107) )( − σ e (cid:112) − a n( v ))= ava + av ( − σ e (cid:112) − a n( v )) + av ( σ e (cid:112) − a n( v ))+ σ ( − σ ) e e (cid:112) − a (cid:112) − a (cid:107) v (cid:107) n( v )= ava + (1 − a ) v = a v + v − a v = v which confirms that all the solutions are valid. Now we obtain the following formula: s = a + σ e (cid:112) − a n( v )for a ∈ [ −
1; 1]. Now it is further simplified by using trigonometric and exponentialseries converging for all arguments. We substitute a = cos( α ) to obtain: a + σ e (cid:112) − a n( v ) = cos( α ) + sin( α ) e n( v )where α ∈ [0; 2 π ). Then, we express the trigonometry using exponential function.We use series expansions which are valid for all α . Note that ( − k = ( e e ) k =( e ) k and (n( v )) k = 1.cos( α ) + sin( α ) e n( v ) = ∞ (cid:88) k =0 ( − k (2 k )! α k + e n( v ) ∞ (cid:88) k =0 ( − k (2 k + 1)! α k +1 = ∞ (cid:88) k =0 ( e ) k (2 k )! α k (n( v )) k + e n( v ) ∞ (cid:88) k =0 ( e ) k (2 k + 1)! α k +1 (n( v )) k = ∞ (cid:88) k =0 ( e ) k (2 k )! α k (n( v )) k + ∞ (cid:88) k =0 ( e ) k +1 (2 k + 1)! α k +1 (n( v )) k +1 = ∞ (cid:88) k =0 ( e α n( v )) k (2 k )! + ∞ (cid:88) k =0 ( e α n( v )) k +1 (2 k + 1)! WING-TWIST DECOMPOSITION IN CLIFFORD ALGEBRA 9 = ∞ (cid:88) k =0 ( e α n( v )) k k ! = exp( e α n( v ))which is precisely the stated general formula. This completes the proof. (cid:3) A spinor which rotates a given vector
The following lemma states what is a spinor which rotates a given vector to beequal to a target one. In literature it is sometimes called direct rotation , as in[3]. Schematic view is presented in figure 3. The lemma is required to prove a
Figure 3.
A direct rotation of AB to AB (cid:48) general theorem about the set of spinors which rotate a given initial vector to agiven target vector. We start with the following initial lemma which applies to theClifford algebra of R . At first the following basic property of C (cid:96) is proved: Lemma 1.
The external product of two given vectors v and w in C (cid:96) can be writtenas: w ∧ v = 12 sgn( v ∧ w e ) (cid:107) v − w (cid:107)(cid:107) v + w (cid:107) e Proof.
Assume that v = x e + y e and w = p e + q e . In special case when w = ± v both sides of the equation are equal to zero therefore the equation holds. In generalcase w (cid:54) = ± v and one can rewrite both sides in coordinates. Left-hand side is equalto: w ∧ v = 12 ( wv − vw ) = 12 (( p e + q e )( x e + y e ) − ( x e + y e )( p e + q e ))= 12 (2 py e − qx e ) = ( py − qx ) e Right-hand side is equal to:12 sgn( v ∧ w e ) (cid:107) v − w (cid:107)(cid:107) v + w (cid:107) e = 12 sgn( 12 ( vw − wv ) e ) (cid:112) ( v − w ) (cid:112) ( v + w ) e = 12 sgn((( x e + y e )( p e + q e ) − ( p e + q e )( x e + y e )) e ) (cid:112) ( v − w ) ( v + w ) e = 12 sgn((2 qx e − py e ) e ) (cid:112) (( x − p ) + ( y − q ) )(( x + p ) + ( y + q ) ) e = 12 sgn( py − qx ) (cid:112) py − qx ) e = sgn( py − qx ) | py − qx | e = ( py − qx ) e Both sides are equal so it completes the proof. (cid:3)
Lemma 2.
Let v and w be a pair of non-zero vectors of equal length in C (cid:96) suchthat v (cid:54) = − w . Then there exist a pair of spinors ± s ∈ Spin(2) which rotate v sothat the rotated vector is equal to w : svs − = w then the pair of spinors is equal to: s = ± n( v + w ) n( v ) Proof.
Let s = a + b e ∈ Spin(2) be a spinor and v = x e + y e , w = p e + q e be a pair of given vectors. The equation can be expressed in coordinates with thefollowing set of equations: (cid:40) ( a − b ) x + 2 aby = p ( a − b ) y − abx = q (18)From the assumption it is impossible that both x and y are simultaneously zero.When x (cid:54) = 0 we solve the set of equations: a − b = p − abyxp − abyx y − abx = q The second equation is then simplified:( p − aby ) y − abx − qx = 02 ab = py − qxx + y Which is then plugged into the first equation of (18):( a − b ) x + py − qxx + y y = p (2 a − x = p − py − qxyx + y a = px + py − py + qxyx ( x + y ) + 1 = px + qyx + y + 1 a = ± (cid:115) x + y + px + qyx + y The same result can be obtained when we consider the other case y (cid:54) = 0: a − b = q + 2 abxyq + 2 abxy x + 2 aby = p The second equation can be simplified:( q + 2 abx ) x + 2 aby − py = 02 ab = py − qxx + y Which is then plugged into the second equation of (18):( a − b ) y − py − qxx + y x = q (2 a − y = q + pxy − qx x + y a = qx + qy + pxy − qx y ( x + y ) + 1 = px + qyx + y + 1 a = ± (cid:115) x + y + px + qy x + y )We obtained one general solution which is correct for all x, y . Now, for each σ ∈ {− , } of a = σ (cid:113) x + y + px + qy x + y ) we have exactly one corresponding solution b . It can be calculated by plugging it into 2 ab = py − qx x + y ) valid for all x, y . When a (cid:54) = 0 then: b = py − qx a ( x + y ) b = ( py − qx ) (cid:112) x + y )2 σ (cid:112) x + y + px + qy ( x + y ) b = σ py − qx (cid:112) x + y + px + qy (cid:112) x + y ) b = σ ( py − qx ) (cid:112) x + y − px − qy (cid:112) ( x + y ) − ( px + qy ) (cid:112) x + y ) b = σ ( py − qx ) (cid:112) x + y − px − qy (cid:112) ( x + y ) − ( px + qy ) (cid:112) x + y ) b = σ ( py − qx ) (cid:112) x + y − px − qy (cid:112) x + y + 2 x y − p x − q y − pqxy (cid:112) x + y ) b = σ ( py − qx ) (cid:112) x + y − px − qy (cid:112) x + y + 2 x y − ( x + y − q ) x − ( x + y − p ) y − pqxy · (cid:112) x + y ) b = σ py − qx (cid:112) ( py − qx ) (cid:115) x + y − px − qy x + y )note that ( py − qx ) e = w ∧ v but it is assumed that v is not parallel to w therefore py − qx (cid:54) = 0. Since e = − py − qx (cid:112) ( py − qx ) = sgn( v ∧ w e )and b is equal to: b = σ sgn( v ∧ w e ) (cid:115) x + y − px − qy x + y ) When a = 0 then from b = 1 − a we know that b = ± σ ∈ {− , } there is a solution: s = σ (cid:115) x + y + px + qy x + y ) + σ sgn( v ∧ w e ) (cid:115) x + y − px − qy x + y ) e s = σ (cid:112) x + y ) ( (cid:112) x + y + px + qy +sgn( v ∧ w e ) (cid:112) x + y − px − qy e ) s = σ (cid:112) x + y ) ( (cid:114)
12 ( x + y + p + q + 2( px + qy ))+sgn( v ∧ w e ) (cid:114)
12 ( x + y + p + q − px + qy )) e ) s = σ (cid:112) x + y ( (cid:112) x + y + p + q + 2( px + qy )+sgn( v ∧ w e ) (cid:112) x + y + p + q − px + qy ) e ) s = σ (cid:107) v (cid:107) ( √ vv + ww + vw + wv +sgn( v ∧ w e ) √ vv + ww − vw − wv e ) s = σ (cid:107) v (cid:107) ( (cid:112) ( v + w ) + sgn( v ∧ w e ) (cid:112) ( v − w ) e ) s = σ (cid:107) v (cid:107) ( (cid:107) v + w (cid:107) + sgn( v ∧ w e ) (cid:107) v − w (cid:107) e )From the assumptions, there is (cid:107) v + w (cid:107) (cid:54) = 0 so: s = σ (cid:107) v (cid:107)(cid:107) v + w (cid:107) ( (cid:107) v + w (cid:107) + sgn( v ∧ w e ) (cid:107) v − w (cid:107)(cid:107) v + w (cid:107) e )Next, the basic identity from lemma 1 is used so the formula can be rewritten withonly external product: w ∧ v = 12 sgn( v ∧ w e ) (cid:107) v − w (cid:107)(cid:107) v + w (cid:107) e It reads that the external product is equal to a bivector whose area is equal to thehalf of the area of the parallelogram spanned by the both vectors and with the signadjusted to the sign of the external product. Using the above identity, the followingfurther simplifications are possible: s = σ (cid:107) v (cid:107)(cid:107) v + w (cid:107) ( (cid:107) v + w (cid:107) + 2 v ∧ w ) s = σ (cid:107) v (cid:107)(cid:107) v + w (cid:107) ( vv + ww + 2 v · w + 2 v ∧ w ) s = σ (cid:107) v (cid:107)(cid:107) v + w (cid:107) ( vv + wv ) s = σ (cid:107) v (cid:107)(cid:107) v + w (cid:107) ( v + w ) vs = ± n( v + w ) n( v ) WING-TWIST DECOMPOSITION IN CLIFFORD ALGEBRA 13
Which is precisely the stated formula. (cid:3)
We observe that the same vector formula applies to any Clifford algebra of n -dimensional real space. Thus, we propose the following: Proposition 2.
Let v and w be a pair of non-zero vectors of equal length in C (cid:96) n such that v (cid:54) = − w . Then there exist a pair of spinors each of which rotate v so thatit is equal to w : svs − = w the pair of spinors is equal to: s = ± n( v + w ) n( v ) Proof.
Instead of the original equation svs − = w an equivalent equation will beproved: sv = ws Let v and w are the given vectors. Start with: v − v = v − v since vv = ww > vv or ww : vvv − wwv = wvv − wvvvvv + wvv = wvv + wwv ( v + w ) vv = w ( v + w ) v it is assumed that v (cid:54) = − w so (cid:107) v + w (cid:107) > (cid:107) v + w (cid:107)(cid:107) v (cid:107) : n( v + w ) n( v ) v = w n( v + w ) n( v )To ensure that s is a spinor it is sufficient to check whether it is a direct productof a scalar and a bivector and whether its norm is equal to 1. Indeed: s = n( v + w ) n( v ) = vv + wv (cid:107) v + w (cid:107)(cid:107) v (cid:107) = (cid:107) v (cid:107) + wv (cid:107) v + w (cid:107)(cid:107) v (cid:107) ∈ (cid:94) R ⊗ (cid:94) R and since s − = n( (cid:107) v (cid:107) + w · v + w ∧ v ) − = n( (cid:107) v (cid:107) + v · w + v ∧ w ) = n( vv + vw ) = n( v ) n( v + w )the norm is: ss − = n( v + w ) n( v ) n( v ) n( v + w ) = (cid:107) n( v + w ) (cid:107) (cid:107) n( v ) (cid:107) = 1Which completes the proof. (cid:3) Since the theorem is valid for C (cid:96) n it is also valid for C (cid:96) . In more generalconclusion, for any dimension there exists a simple formula giving a pair of spinorsrotating a given vector so that it covers another given vector of the same length. The set of spinors which rotate a given initial vector to a giventarget vector
There are two ways of defining a swing-twist representation (composition ordecomposition): • twist q is done before swing p ; for a given spinor r we have: s = pq .This is the swing-after-twist representation. • twist q is done after swing p ; for a given spinor r we have: s = qp .This is the twist-after-swing representation.The swing-after-twist representation is used in [1] while the twist-after-swing rep-resentation is usually used in the direct method. Since in practice both conventionsare used (the first one is slightly less common) in this paper both decompositionswill be presented and proved. The following theorem is a general solution to Cliffordproduct equation: svs − = w We prove the following
Proposition 3.
Let v and w be a pair of non-zero vectors of equal length in C (cid:96) such that v (cid:54) = − w . The set of spinor solutions s ∈ Spin(3) to svs − = w in the case of swing-after-twist representation is equal to: s = ± n( v + w ) n( v ) exp( e α n( v )) and in the case of twist-after-swing representation is equal to: s = ± exp( e α n( w )) n( v + w ) n( v ) Proof.
The solution is the set of all possible rotations which swing axis from initial v to terminal w with any possible twist during the movement. Using propositions 1and 2 one composes swing and twist according to the order used in a given represen-tation. In the case of swing-after-twist representation twist q = exp( e α n( v )) fac-tor (around v axis) is applied at first and only after it, swing factor p = n( v + w ) n( v )is applied (swinging the axis from v to w ). In the other case of twist-after-swingrepresentation swing p = n( v + w ) n( v ) is applied first (swinging the axis from v to w ) and after that twist factor q = exp( e α n( w )) is applied with respect to theterminal axis w . (cid:3) Swing-twist decomposition of a spinor
This is the main result of this paper. In this section the inverse of formulas givenin proposition 3 is derived. Given a spinor it is possible to calculate its decomposi-tion into twist and swing factors in respect to a given non-zero vector. Since thereare two different swing-twist representations, there are also two swing-twist decom-positions for swing-after-twist and twist-after-swing representation respectively. Inthis section, the initial vector will be called a base vector.
Theorem 1 (Swing-twist decomposition of a spinor in swing-after-twist represen-tation) . Assume that s ∈ Spin(3) is a spinor. For any non-zero base vector v ∈ C (cid:96) such that svs − (cid:54) = − v there exist a unique up to the sign swing-twist decompo-sition in swing-after-twist representation s = ± pq WING-TWIST DECOMPOSITION IN CLIFFORD ALGEBRA 15 where swing spinor p and twist spinor q are equal to: p = ± s ˜ σ v ( s ) q = ± σ v ( s ) where σ v ( s ) : Spin(3) −→ Spin(3) is a function of spinor s : σ b ( s ) = n( v ( v · s )) the reversion ˜ σ v ( s ) is equal to: ˜ σ v ( s ) = n( v ( v · ˜ s )) The function σ v ( s ) will be called a twist projection function .Proof. The proof is divided into several steps. At first the problem is reformulatedin coordinates. Then, twist angle is calculated and twist spinor and finally swingspinor. Denote the following: s = a + b e + c e + d e v = v x e + v y e + v z e w = w x e + w y e + w z e The angle α will be described implicitly by:cos( α ) = k sin( α ) = lk + l = 1Vector w exists on the assumption that svs − (cid:54) = − v . What does this assumptionrequire about the base vector and the spinor is explained in the appendix of thispaper. At first, the equation is rewritten in coordinates. The swing factor is equalto: p = n( w + v ) n( v )= (( w x + v x ) e + ( w y + v y ) e + ( w z + v z ) e )( v x e + v y e + v z e ) (cid:112) ( w x + v x ) + ( w y + v y ) + ( w z + v z ) (cid:113) v x + v y + v z = (( w x + v x ) + ( w y + v y ) + ( w z + v z ) ) − ( v x + v y + v z ) − · [( w x + v x ) v x + ( w y + v y ) v y + ( w z + v z ) v z +(( w x + v x ) v y − ( w y + v y ) v x ) e + (( w y + v y ) v z − ( w z + v z ) v y ) e +(( w z + v z ) v x − ( w x + v x ) v z ) e ]Twist factor is equal to:(19) q = cos( α ) + e n( v ) sin( α ) = k + l (cid:113) v x + v y + v z ( b z e + b x e + b y e )Combining the above formulas there is: pq = (( w x + v x ) + ( w y + v y ) + ( w z + v z ) ) − ( v x + v y + v z ) − · [( w x + v x ) v x + ( w y + v y ) v y + ( w z + v z ) v z +(( w x + v x ) v y − ( w y + v y ) v x ) e + (( w y + v y ) v z − ( w z + v z ) v y ) e +(( w z + v z ) v x − ( w x + v x ) v z ) e ] · [ k + l (cid:113) v x + v y + v z ( b z e + b x e + b y e )]= (( w x + v x ) + ( w y + v y ) + ( w z + v z ) ) − ( v x + v y + v z ) − · [ k (( w x + v x ) v x + ( w y + v y ) v y + ( w z + v z ) v z )+( k ( w x v y − w y v x ) + l (cid:113) v x + v y + v z ( w z + v z )) e +( k ( w y v z − w z v y ) + l (cid:113) v x + v y + v z ( w x + v x )) e +( k ( w z v x − w x v z ) + l (cid:113) v x + v y + v z ( w y + v y )) e ]Two spinors are equal if and only if corresponding coefficients are equal. There-fore the following set of equations determines the solution:(20) a = [ k (( w x + v x ) v x + ( w y + v y ) v y + ( w z + v z ) v z )]∆ b = [ k ( w x v y − w y v x ) + l (cid:113) v x + v y + v z ( w z + v z )]∆ c = [ k ( w y v z − w z v y ) + l (cid:113) v x + v y + v z ( w x + v x )]∆ d = [ k ( w z v x − w x v z ) + l (cid:113) v x + v y + v z ( w y + v y )]∆ k + l = 1 w x + w y + w z = v x + v y + v z a + b + c + d = 1Where ∆ = (( w x + v x ) +( w y + v y ) +( w z + v z ) ) − ( v x + v y + v z ) − . By substitutingvariables in the set of equations (20) it is easy to rise unfavourably the degree ofinvolved polynomials. Thus the following careful operations are performed. First,note that it is easy to obtain variable k from the first equation:(21) a = k ( w + v ) · v (cid:107) w + v (cid:107)(cid:107) v (cid:107) Observe that: (cid:107) w + v (cid:107) = ( w + v )( w + v ) = ww + vv + wv + vw = 2( v · v + v · w ) = 2 v · ( w + v )Using this, one simplifies (21) to: a = k ( w + v ) · v (cid:107) w + v (cid:107)(cid:107) v (cid:107) = k (cid:107) w + v (cid:107) (cid:107) w + v (cid:107)(cid:107) v (cid:107) = k (cid:107) w + v (cid:107) (cid:107) v (cid:107) From that one obtains the value of k :(22) k = a (cid:107) v (cid:107)(cid:107) w + v (cid:107) The value of k is now put into the set of equations (20) which then can be simplifiedto:(23) b (cid:107) w + v (cid:107) = 2 a (cid:107) w + v (cid:107) ( w x v y − w y v x ) + l ( w z + v z ) c (cid:107) w + v (cid:107) = 2 a (cid:107) w + v (cid:107) ( w y v z − w z v y ) + l ( w x + v x ) d (cid:107) w + v (cid:107) = 2 a (cid:107) w + v (cid:107) ( w z v x − w x v z ) + l ( w y + v y ) WING-TWIST DECOMPOSITION IN CLIFFORD ALGEBRA 17
It is a set of three linear equations with three unknowns M [ w x , w y , w z ] T = N . Thecharacteristic matrix M is: M = (cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12) a (cid:107) w + v (cid:107) v y − a (cid:107) w + v (cid:107) v x ll a (cid:107) w + v (cid:107) v z − a (cid:107) w + v (cid:107) v y − a (cid:107) w + v (cid:107) v z l a (cid:107) w + v (cid:107) v x (cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12) and the vector N is equal to: N = [ b (cid:107) w + v (cid:107) − lv z , c (cid:107) w + v (cid:107) − lv x , d (cid:107) w + v (cid:107) − lv y ] T Any known method can be used to compute the determinant of M which is equalto: det ( M ) = l The case l = 0 needs special care and will be now discussed separately. In this case,from (19) twist factor is equal to: q = k + l (cid:113) v x + v y + v z ( b z e + b x e + b y e ) = k Since q is a spinor, its component k must be equal to: k = ± p = ± sq = ± v and spinors s such that α = zπ, z ∈ Z . In the case of l (cid:54) = 0 there exist exactly one solution to(23). After having the matrix inverted and solution calculated, one gets: w x = [4 a ( v x + v y + v z ) l + (cid:107) w + v (cid:107) l ] − [2 a ( bv y − dv z ) (cid:107) w + v (cid:107) l + (cid:107) w + v (cid:107) l ( c (cid:107) w + v (cid:107) − v x l ) + 4 a v x (( bv z + v x c + v y d ) (cid:107) w + v (cid:107) − ( v x + v y + v z ) l )] w y = [4 a ( v x + v y + v z ) l + (cid:107) w + v (cid:107) l ] − [2 a ( − bv x + cv z ) (cid:107) w + v (cid:107) l + (cid:107) w + v (cid:107) l ( d (cid:107) w + v (cid:107) − v y l ) + 4 a v y (( bv z + v x c + v y d ) (cid:107) w + v (cid:107) − ( v x + v y + v z ) l )] w z = [4 a ( v x + v y + v z ) l + (cid:107) w + v (cid:107) l ] − [2 a ( cv y + dv x ) (cid:107) w + v (cid:107) l + (cid:107) w + v (cid:107) l ( b (cid:107) w + v (cid:107) − v z l ) + 4 a v z (( bv z + v x c + v y d ) (cid:107) w + v (cid:107) − ( v x + v y + v z ) l )]All three denominators are equal and can be simplified:4 a ( v x + v y + v z ) l + (cid:107) w + v (cid:107) l = l (4 a (cid:107) v (cid:107) + (cid:107) w + v (cid:107) (1 − a (cid:107) v (cid:107) (cid:107) w + v (cid:107) )) = l (cid:107) w + v (cid:107)
28 PRZEMYS(cid:32)LAW DOBROWOLSKI
A compact form is achieved with the following simplifications: (cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12) w x w y w z (cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12) = 1 l (cid:107) w + v (cid:107) (2 a (cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12) bv y − dv z cv z − bv x dv x − cv y (cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12) (cid:107) w + v (cid:107) l + (cid:107) w + v (cid:107) l (cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12) c (cid:107) w + v (cid:107) − v x ld (cid:107) w + v (cid:107) − v y lb (cid:107) w + v (cid:107) − v z l (cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12) +4 a (cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12) v x v y v z (cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12) (( bv z + cv x + dv y ) (cid:107) w + v (cid:107) − (cid:107) v (cid:107) l ))= 2 a (cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12) v x v y v z (cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12) × (cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12) cdb (cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12) + l (cid:107) w + v (cid:107) (cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12) cdb (cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12) − l (cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12) v x v y v z (cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12) + 4 a l (cid:107) w + v (cid:107) (cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12) v x v y v z (cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12) ( (cid:107) w + v (cid:107) (cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12) v x v y v z (cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12) · (cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12) cdb (cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12) − (cid:107) v (cid:107) l )Vector [ c, d, b ] T can be formulated with coefficients of spinor s : (cid:63) [ s ] = − e [ s ] = − e ( b e + c e + d e ) = c e + d e + b e With this substitution further simplification is possible: w = 2 av × (cid:63) [ s ] + l (cid:107) w + v (cid:107) (cid:63) [ s ] − l v + 4 a l (cid:107) w + v (cid:107) v ( (cid:107) w + v (cid:107) v · (cid:63) [ s ] − (cid:107) v (cid:107) l )but form previous equations there is:(24) l = 1 − a (cid:107) v (cid:107) (cid:107) w + v (cid:107) so after substitution one obtains: w = 2 av × (cid:63) [ s ] + l (cid:107) w + v (cid:107) (cid:63) [ s ] − v + 4 a vl (cid:107) w + v (cid:107) v · (cid:63) [ s ] The above formula is useful to compute (cid:107) w + v (cid:107) . Note that one can move − v tothe left hand side of the equation and compute lengths of both sides. (cid:107) w + v (cid:107) = (2 av × (cid:63) [ s ] + l (cid:107) w + v (cid:107) (cid:63) [ s ] + 4 a vl (cid:107) w + v (cid:107) v · (cid:63) [ s ] ) = (2 av × (cid:63) [ s ] ) + ( l (cid:107) w + v (cid:107) (cid:63) [ s ] ) + ( 4 a vl (cid:107) w + v (cid:107) v · (cid:63) [ s ] ) + 2[(2 av × (cid:63) [ s ] ) · ( l (cid:107) w + v (cid:107) (cid:63) [ s ] ) + (2 av × (cid:63) [ s ] ) · ( 4 a vl (cid:107) w + v (cid:107) v · (cid:63) [ s ] )+ ( l (cid:107) w + v (cid:107) (cid:63) [ s ] ) · ( 4 a vl (cid:107) w + v (cid:107) v · (cid:63) [ s ] )]= 4 a ( b × (cid:63) [ s ] ) + l (cid:107) w + v (cid:107) ( (cid:63) [ s ] ) + 16 a (cid:107) v (cid:107) l (cid:107) w + v (cid:107) ( v · (cid:63) [ s ] ) + 8 a ( v · (cid:63) [ s ] ) From the property that ( b × (cid:63) [ s ] ) + ( b · (cid:63) [ s ] ) = (cid:107) b (cid:107) ( (cid:63) [ s ] ) the following formulais obtained: (cid:107) w + v (cid:107) = 4 a (cid:107) b (cid:107) ( (cid:63) [ s ] ) + l (cid:107) w + v (cid:107) ( (cid:63) [ s ] ) +4 a ( v · (cid:63) [ s ] ) + 16 a (cid:107) v (cid:107) l (cid:107) w + v (cid:107) ( v · (cid:63) [ s ] ) There is:(25) l (cid:107) w + v (cid:107) = (cid:18) − a (cid:107) v (cid:107) (cid:107) w + v (cid:107) (cid:19) (cid:107) w + v (cid:107) = (cid:107) w + v (cid:107) − a (cid:107) v (cid:107) So one can write the following equivalent formula: (cid:107) w + v (cid:107) = 4 a (cid:107) b (cid:107) ( (cid:63) [ s ] ) + ( (cid:107) w + v (cid:107) − a (cid:107) v (cid:107) )( (cid:63) [ s ] ) +4 a ( v · (cid:63) [ s ] ) + 16 a (cid:107) v (cid:107) l (cid:107) w + v (cid:107) ( v · (cid:63) [ s ] ) = (cid:107) w + v (cid:107) ( (cid:63) [ s ] ) + 4 a ( v · (cid:63) [ s ] ) + 16 a (cid:107) v (cid:107) l (cid:107) w + v (cid:107) ( v · (cid:63) [ s ] ) Substituting ( (cid:63) [ s ] ) = 1 − a and once again (25) one obtains: (cid:107) w + v (cid:107) = (cid:107) w + v (cid:107) (1 − a ) + ( v · (cid:63) [ s ] ) (cid:18) a ( (cid:107) w + v (cid:107) − a (cid:107) v (cid:107) ) + 16 a (cid:107) v (cid:107) l (cid:107) w + v (cid:107) (cid:19) Which can be simplified to: a (cid:107) w + v (cid:107) = ( v · (cid:63) [ s ] ) a l a ( (cid:107) w + v (cid:107) − a (cid:107) v (cid:107) ) = 4 a ( v · (cid:63) [ s ] ) There are two cases. When a (cid:54) = 0 the following equation applies: (cid:107) w + v (cid:107) = 4( v · (cid:63) [ s ] ) + 4 a (cid:107) v (cid:107) Using the above identity, there is: l (cid:107) w + v (cid:107) = (cid:107) w + v (cid:107) − a (cid:107) v (cid:107) = 4( v · (cid:63) [ s ] ) + 4 a (cid:107) v (cid:107) − a (cid:107) v (cid:107) l (cid:107) w + v (cid:107) = 4( v · (cid:63) [ s ] ) Modifying the identity (24) there is: l = 1 − a (cid:107) v (cid:107) (cid:107) w + v (cid:107) (cid:107) w + v (cid:107) − a (cid:107) v (cid:107) = l (cid:107) w + v (cid:107) (cid:107) w + v (cid:107) − a (cid:107) v (cid:107) = 4( v · (cid:63) [ s ] ) (cid:107) w + v (cid:107) = 4( v · (cid:63) [ s ] ) + 4 a (cid:107) v (cid:107) (cid:107) w + v (cid:107) = 2 (cid:112) ( v · (cid:63) [ s ] ) + a (cid:107) v (cid:107) Using the formula (22) one obtains the value of k :(26) k = a (cid:107) v (cid:107)(cid:107) w + v (cid:107) = a (cid:107) v (cid:107) (cid:112) ( v · (cid:63) [ s ] ) + a (cid:107) v (cid:107) = a (cid:107) v (cid:107) (cid:112) ( v · (cid:63) [ s ] ) + a (cid:107) v (cid:107) Again from (24) it is possible to calculate l : l = 1 − a (cid:107) v (cid:107) (cid:107) w + v (cid:107) = 1 − a (cid:107) v (cid:107) v · (cid:63) [ s ] ) + a (cid:107) v (cid:107) ]= ( v · (cid:63) [ s ] ) + a (cid:107) v (cid:107) ( v · (cid:63) [ s ] ) + a (cid:107) v (cid:107) − a (cid:107) v (cid:107) ( v · (cid:63) [ s ] ) + a (cid:107) v (cid:107) = ( v · (cid:63) [ s ] ) ( v · (cid:63) [ s ] ) + a (cid:107) v (cid:107) It is possible to take the square root and abandon sign. This comes from the factthat when s is a given spinor then the solution represented by variable l must include the solution for − s as well. In that case the numerator is negated, so also − l is a solution automatically.(27) l = v · (cid:63) [ s ] (cid:112) ( v · (cid:63) [ s ] ) + a (cid:107) v (cid:107) In the case when a = 0 from (24) there is: l = 1 k = 1 − l = 0The same argumentation as above can be used to select any solution of l = 1.Both cases are special cases of (26) and (27) so it is sufficient to consider only thosegeneral solutions. The twist factor equal to: q = k + e n( v ) l == a (cid:107) v (cid:107) (cid:112) ( v · (cid:63) [ s ] ) + 4 a (cid:107) v (cid:107) + e n( v )( v · (cid:63) [ s ] ) (cid:112) ( v · (cid:63) [ s ] ) + a (cid:107) v (cid:107) = a (cid:107) v (cid:107) + n( v )( v · (cid:63) [ s ]) (cid:112) ( v · (cid:63) [ s ] ) + a (cid:107) v (cid:107) = a (cid:107) v (cid:107) + n( v )( v · s ) − n( v )( v · [ s ] ) (cid:112) ( v · (cid:63) [ s ] ) + a (cid:107) v (cid:107) = a (cid:107) v (cid:107) + n( v )( v · s ) − a (cid:107) v (cid:107) (cid:112) ( v · (cid:63) [ s ] ) + a (cid:107) v (cid:107) = n( v )( v · s ) (cid:112) ( v · (cid:63) [ s ] ) + a (cid:107) v (cid:107) Define a norm of a pinor p = p + p e + p e + p e ∈ Pin(3):n( p ) := p √ p ˜ p = p + p e + p e + p e (cid:112) p + p + p + p ∈ Spin(3)where ˜ p = p − p e − p e − p e .Using the fact that s = a + e (cid:63) [ s ] the numerator of twist factor can be writtenas: n( v )( v · s ) = n( v )( v · ( a + e (cid:63) [ s ] ) = n( v )( va + e v · (cid:63) [ s ] )= a (cid:107) v (cid:107) + e n( v ) v · (cid:63) [ s ] (28)the norm of the numerator of twist factor is equal to: (cid:112) ( a (cid:107) v (cid:107) + e n( v ) v · (cid:63) [ s ] )( a (cid:107) v (cid:107) − e n( v ) v · (cid:63) [ s ] )= (cid:112) a (cid:107) v (cid:107) + ( e n( v ) v · (cid:63) [ s ] ) = (cid:112) a (cid:107) v (cid:107) + ( v · (cid:63) [ s ] ) one notices that it is equal to the denominator. In result, it is possible to writesimply: q = n( v ( v · s ))The swing factor is calculated by modifying the original equation: s = pqp = sq − by using (28) twist inverse can be easily calculated: q − = ˜ q = ˜ σ v ( s ) = (cid:94) a (cid:107) v (cid:107) + e n( v ) v · (cid:63) [ s ] = a (cid:107) v (cid:107) − e n( v ) v · (cid:63) [ s ] = a (cid:107) v (cid:107) + e n( v ) v · (cid:63) [ − s ] = n( v )( va + e v · (cid:63) [ − s ] )= n( v )( v · ( a + e (cid:63) [ − s ] )) = n( v )( v · ˜ s ) WING-TWIST DECOMPOSITION IN CLIFFORD ALGEBRA 21 so p = s ˜ σ v ( s )where ˜ σ v ( s ) = n( v )( v · ˜ s ). Both swing and twist factors can be negated as a givenspinor and its negation define the same rotation: p = ± s ˜ σ v ( s ) q = ± σ v ( s )which completes the proof. (cid:3) The following dual theorem can be easily proved with the previous theorem (1):
Theorem 2 (Swing-twist decomposition of a spinor in twist-after-swing represen-tation) . Assume that s ∈ Spin(3) is a spinor. For any non-zero base vector v ∈ C (cid:96) such that svs − (cid:54) = − v there exist a unique up to the sign swing-twist decompo-sition in twist-after-swing representation s = ± qp where swing spinor p and twist spinor q are equal to: p = ± ˜ σ v ( s ) sq = ± σ v ( s ) where σ v ( s ) is a twist projection function.Proof. Assume that u = s − . According to theorem 2 there exists a swing-twistdecomposition of spinor u in swing-after-twist representation: u = ± pq where p is a swing factor and q is a twist factor of u in respect to the base vector v . Taking inverse of both sides one obtains: u − = s = ± q − p − which is a twist-after-swing decomposition of spinor s . Swing and twist factors canbe rewritten as: p − = ( u ˜ σ v ( u )) − = ( s − ˜ σ v ( s − )) − = ˜ σ v ( s − ) − s = ˜ σ v ( s ) sq − = σ v ( u ) − = σ v ( s − ) − = σ v ( s )which completes the proof. (cid:3) Twist projection function
In this section basic properties of the twist projection function are discussed.Intuitively, twist projection function takes a spinor and returns its twist factor inrespect to a given vector. In this paper the following definition was assumed σ v ( s ) := n( v ( v · s ))This is algebraically equivalent to projecting it onto a vector in the sense of Clif-ford algebra. This an improvement over the work of Huyghe [1] where the authorintroduces similar projection operator artificially in quaternion algebra. Twist pro-jection function is a projection due to the following Proposition 4.
A twist projection function is a projection.
Proof.
It is enough to prove that σ v ( σ v ( s )) = σ v ( s ) for any vector v and any spinor w : σ v ( σ v ( s )) = n( v ( v · n( v ( v · s )))) = n( v ( v · a (cid:107) v (cid:107) + e n( v )( v · (cid:63) [ s ] ) (cid:112) ( v · (cid:63) [ s ] ) + a (cid:107) v (cid:107) ))= n( v v · a (cid:107) v (cid:107) + e ( v · n( v ))( v · (cid:63) [ s ] ) (cid:112) ( v · (cid:63) [ s ] ) + a (cid:107) v (cid:107) ) = n( v v · a (cid:107) v (cid:107) + e (cid:107) v (cid:107) v · (cid:63) [ s ] (cid:112) ( v · (cid:63) [ s ] ) + a (cid:107) v (cid:107) )= n( v ( (cid:107) v (cid:107) v ) · ( a + (cid:63) [ s ] ) (cid:112) ( v · (cid:63) [ s ] ) + a (cid:107) v (cid:107) ) = n( (cid:107) v (cid:107) n( v )( v · s ) (cid:112) ( v · (cid:63) [ s ] ) + a (cid:107) v (cid:107) )= n( v ( v · s )) = σ v ( s )which completes the proof. (cid:3) Applications
In this section an exemplary application of the proposed theoretical results ispresented. It is a fast, concise and numerically stable algorithm for calculatingswing-twist decomposition of a spinor.9.1.
An efficient algorithm for swing-twist decomposition of a spinor.
Topropose an efficient method of calculating swing-twist decomposition the followingformula is used for twist projection function: σ v ( s ) = n( v ( v · s )) = n( v ( v · ( a + e (cid:63) [ s ] )) == n( v ( va + e v · (cid:63) [ s ] )) = n( a (cid:107) v (cid:107) + e v ( v · (cid:63) [ s ] ))If a rotation is represented by a pinor normalization can be omitted. In case ofspinor representation normalization is needed and requires square root computa-tion or equivalently requires arithmetic with square root extension. The proposedmethod uses swing-after-twist representation and is presented in algorithm 1. Algorithm 1
Compute swing-twist decomposition of a spinor s = pq Require: v = x e + y e + z e , s = a + b e + c e + d e Ensure: (cid:107) v (cid:107) (cid:54) = 0 u ← xc + yd + zbn ← x + y + z m ← anl ← √ m + u nq ← ml + zul e + xul e + yul e p ← s ˜ q return p, qBecause of its simplicity the proposed method favourably compares to existingmethods for computing swing-twist decomposition (as presented in section 2. Appendix A. Which decompositions are impossible
When a combination of a spinor and a base vector cannot be decomposed intoswing and twist. From theorem 1 or 2 a decomposition is impossible when: svs − = − v WING-TWIST DECOMPOSITION IN CLIFFORD ALGEBRA 23 the above condition can be rewritten in terms of spinor coordinates. Using (3) onewrites ( a − b + c − d + 1) x + 2 y ( ab + cd ) + 2 z ( bc − ad ) = 0( a − b − c + d + 1) y + 2 x ( cd − ab ) + 2 z ( bd + ac ) = 0( a + b − c − d + 1) z + 2 x ( bc + ad ) + 2 y ( bd − ac ) = 0 a + b + c + d − W i the left side of i th equation of 29. A valid solution ( a, b, c, d ) mustsatisfy the following equation: xW + yW + zW + ( x + y + z ) W = 0the above formula can be expanded:( a − b + c − d + 1) x + 2 xy ( ab + cd ) + 2 xz ( bc − ad )+ ( a − b − c + d + 1) y + 2 xy ( cd − ab ) + 2 yz ( bd + ac )+ ( a + b − c − d + 1) z + 2 xz ( bc + ad ) + 2 yz ( bd − ac )+ ( x + y + z )( a + b + c + d −
1) = 0( a − b + c − d + 1 + a + b + c + d − x + 2 xycd + 2 xzbc + ( a − b − c + d + 1 + a + b + c + d − y + 2 xycd + 2 yzbd + ( a + b − c − d + 1 + a + b + c + d − z + 2 xzbc + 2 yzbd = 0( cx + dy + bz ) + a ( x + y + z ) = 0which implies that the two identities must hold: a ( x + y + z ) ∧ cx + dy + bz = 0but since (cid:107) v (cid:107) (cid:54) = 0 it must be a = 0 ∧ v · (cid:63) [ s ] = 0These conditions define when a spinor can be written as a swing-twist decompositionin respect to a given base vector. References [1] B. Huyghe, Design and Implementation of a Mobile Sensor System for Human Posture Track-ing, Ph.D. thesis, Ghent University (2011).[2] P. Baerlocher, Inverse Kinematics Techniques for the Interactive Posture Control of ArticulatedFigures, Ph.D. thesis, Swiss Federal Institute of Technology (2001).[3] P. Baerlocher, R. Boulic, Parametrization and Range of Motion of the Ball-and-Socket Joint,in: Proceedings of the IFIP TC5/WG5.10 DEFORM’2000 Workshop and AVATARS’2000Workshop on Deformable Avatars, DEFORM ’00/AVATARS ’00, Kluwer, B.V., Deventer,The Netherlands, The Netherlands, 2001, pp. 180–190.[4] F. S. Grassia, Practical Parameterization of Rotations Using the Exponential Map, J. Graph.Tools 3 (3) (1998) 29–48.[5] J. Korein, A Geometric Investigation of Reach, The MIT Press, 1985.[1] B. Huyghe, Design and Implementation of a Mobile Sensor System for Human Posture Track-ing, Ph.D. thesis, Ghent University (2011).[2] P. Baerlocher, Inverse Kinematics Techniques for the Interactive Posture Control of ArticulatedFigures, Ph.D. thesis, Swiss Federal Institute of Technology (2001).[3] P. Baerlocher, R. Boulic, Parametrization and Range of Motion of the Ball-and-Socket Joint,in: Proceedings of the IFIP TC5/WG5.10 DEFORM’2000 Workshop and AVATARS’2000Workshop on Deformable Avatars, DEFORM ’00/AVATARS ’00, Kluwer, B.V., Deventer,The Netherlands, The Netherlands, 2001, pp. 180–190.[4] F. S. Grassia, Practical Parameterization of Rotations Using the Exponential Map, J. Graph.Tools 3 (3) (1998) 29–48.[5] J. Korein, A Geometric Investigation of Reach, The MIT Press, 1985.