Example: tourism industry

Quaternion Algebra and Calculus - Geometric Tools

Quaternion Algebra and CalculusDavid Eberly, Geometric Tools , Redmond WA 98052 work is licensed under the Creative Commons Attribution International License. To view a copyof this license, visit or send a letter to Creative Commons,PO Box 1866, Mountain View, CA 94042, : March 2, 1999 Last Modified: August 18, 2010 Contents1 Quaternion Algebra22 Relationship of Quaternions to Rotations33 Quaternion Calculus54 Spherical Linear Interpolation65 Spherical Cubic Interpolation76 Spline Interpolation of Quaternions81 This document provides a mathematical summary of Quaternion Algebra and Calculus and how they relateto rotations and interpolation of rotations. The ideas are based on the article [1].1 Quaternion AlgebraAquaternionis given byq=w+xi+yj+zkwherew,x,y, andzare real numbers.

This document provides a mathematical summary of quaternion algebra and calculus and how they relate to rotations and interpolation of rotations. The ideas are based on the article [1]. ... vector ^vis rotated by an angle ˚to the vector q^vq , so ^v (qvq^ ) = cos(˚). Using equation (8) and ^v = ^v,

Tags:

  Vector, Calculus, Algebra, Quaternion algebra and calculus, Quaternion

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of Quaternion Algebra and Calculus - Geometric Tools

1 Quaternion Algebra and CalculusDavid Eberly, Geometric Tools , Redmond WA 98052 work is licensed under the Creative Commons Attribution International License. To view a copyof this license, visit or send a letter to Creative Commons,PO Box 1866, Mountain View, CA 94042, : March 2, 1999 Last Modified: August 18, 2010 Contents1 Quaternion Algebra22 Relationship of Quaternions to Rotations33 Quaternion Calculus54 Spherical Linear Interpolation65 Spherical Cubic Interpolation76 Spline Interpolation of Quaternions81 This document provides a mathematical summary of Quaternion Algebra and Calculus and how they relateto rotations and interpolation of rotations. The ideas are based on the article [1].1 Quaternion AlgebraAquaternionis given byq=w+xi+yj+zkwherew,x,y, andzare real numbers.

2 Defineqn=wn+xni+ynj+znk(n= 0,1).Additionandsubtractionof quaternions is defined byq0 q1= (w0+x0i+y0j+z0k) (w1+x1i+y1j+z1k)= (w0 w1) + (x0 x1)i+ (y0 y1)j+ (z0 z1)k.(1)Multiplication for the primitive elementsi,j, andkis defined byi2=j2=k2= 1,ij= ji=k,jk= kj=i, andki= ik= quaternions is defined byq0q1= (w0+x0i+y0j+z0k)(w1+x1i+y1j+z1k)= (w0w1 x0x1 y0y1 z0z1)+(w0x1+x0w1+y0z1 z0y1)i+(w0y1 x0z1+y0w1+z0x1)j+(w0z1+x0y1 y0x1+z0w1)k.(2)Multiplication is not commutative in that the productsq0q1andq1q0are not necessarily a Quaternion is defined byq = (w+xi+yj+zk) =w xi yj zk.(3)The conjugate of a product of quaternions satisfies the properties (p ) =pand (pq) =q p .Thenormof a Quaternion is defined byN(q) =N(w+xi+yj+zk) =w2+x2+y2+z2.(4)The norm is a real-valued function and the norm of a product of quaternions satisfies the propertiesN(q ) =N(q) andN(pq) =N(p)N(q).

3 Themultiplicative inverseof a quaternionqis denotedq 1and has the propertyqq 1=q 1q= 1. It isconstructed asq 1=q /N(q)(5)where the division of a Quaternion by a real-valued scalar is just componentwise division. The inverseoperation satisfies the properties (p 1) 1=pand (pq) 1=q 1p simple but useful function is theselectionfunctionW(q) =W(w+xi+yj+zk) =w(6)which selects the real part of the Quaternion . This function satisfies the propertyW(q) = (q+q ) quaternionq=w+xi+yj+zkmay also be viewed asq=w+ vwhere v=xi+yj+zk. If we identify vwith the 3D vector (x,y,z), then Quaternion multiplication can be written using vector dot product ( )and cross product ( ) as(w0+ v0)(w1+ v1) = (w0w1 v0 v1) +w0 v1+w1 v0+ v0 v1.(7)In this form it is clear thatq0q1=q1q0if and only if v0 v1= 0 (these two vectors are parallel).

4 A quaternionqmay also be viewed as a 4D vector (w,x,y,z). Thedot productof two quaternions isq0 q1=w0w1+x0x1+y0y1+z0z1=W(q0q 1).(8)Aunit quaternionis a quaternionqfor whichN(q) = 1. The inverse of a unit Quaternion and the productof unit quaternions are themselves unit quaternions. A unit Quaternion can be represented byq= cos + usin (9)where uas a 3D vector has length 1. However, observe that the Quaternion product u u= 1. Note thesimilarity to unit length complex numbers cos +isin . In fact, Euler s identity for complex numbersgeneralizes to quaternions,exp( u ) = cos + usin ,(10)where the exponential on the left-hand side is evaluated by symbolically substituting u into the power seriesrepresentation for exp(x) and replacing products u uby 1.

5 From this identity it is possible to define thepowerof a unit Quaternion ,qt= (cos + usin )t= exp( ut ) = cos(t ) + usin(t ).(11)It is also possible to define thelogarithmof a unit Quaternion ,log(q) = log(cos + usin ) = log(exp( u )) = u .(12)It is important to note that the noncommutativity of Quaternion multiplication disallows the standardidentities for exponential and logarithm functions. The quaternions exp(p) exp(q) and exp(p+q) are notnecessarily equal. The quaternions log(pq) and log(p) + log(q) are not necessarily Relationship of Quaternions to RotationsA unit quaternionq= cos + usin represents the rotation of the 3D vector vby an angle 2 about the 3 Daxis u. The rotated vector , represented as a Quaternion , isR( v) =q vq . The proof requires showing thatR( v) is a 3D vector , a length-preserving function of 3D vectors, a linear transformation, and does not havea reflection see thatR( v) is a 3D vector ,W(R( v)) =W(q vq )= [(q vq ) + (q vq ) ]/2= [q vq +q v q ]/2=q[( v+ v )/2]q =qW( v)q =W( v)= see thatR( v) is length-preserving,N(R( v)) =N(q vq )=N(q)N( v)N(q )=N(q)N( v)N(q)=N( v).

6 To see thatR( v) is a linear transformation, letabe a real-valued scalar and let vand wbe 3D vectors; thenR(a v+ w) =q(a v+ w)q = (qa vq ) + (q wq )=a(q vq ) + (q wq )=aR( v) +R( w),thereby showing that the transform of a linear combination of vectors is the linear combination of previous three properties show thatR( v) is an orthonormal transformation. Such transformationsinclude rotationsandreflections. ConsiderRas a function ofqfor afixed vector v. That is,R(q) =q vq .This function is a continuous function ofq. For eachqit is a linear transformation with determinantD(q), sothe determinant itself is a continuous function ofq. Thus, limq 1R(q) =R(1) =I, the identity function (thelimit is taken along any path of quaternions which approach the Quaternion 1) and limq 1D(q) =D(1) = continuity,D(q) is identically 1 andR(q) does not have a reflection we prove that the unit rotation axis is the 3D vector uand the rotation angle is 2.

7 To see that uis aunit rotation axis we need only show that uis unchanged by the rotation. Recall that u2= u u= 1. Thisimplies that u3= u. NowR( u) =q uq = (cos + usin ) u(cos usin )= (cos )2 u (sin )2 u3= (cos )2 u (sin )2( u)= see that the rotation angle is 2 , let u, v, and wbe a right-handed set of orthonormal vectors. That is,the vectors are all unit length; u v= u w= v w= 0; and u v= w, v w= u, and w u= v. Thevector vis rotated by an angle to the vectorq vq , so v (q vq ) = cos( ). Using equation (8) and v = v,and p2= 1 for unit quaternions with zero real part,cos( ) = v (q vq )=W( v q vq )=W[ v(cos + usin ) v(cos usin )]=W[( vcos v usin )( vcos v usin )]=W[ v2(cos )2+ v2 usin cos v u vsin cos + ( v u)2(sin )2]=W[(cos )2 (sin )2 ( u+ v u v) sin cos ]Now v u= v u+ v u= v u= wand v u v= w v= w v w v= u.

8 Consequently,cos( ) =W[(cos )2 (sin )2 ( u+ v u v) sin cos ]=W[(cos )2 (sin )2 u(2 sin cos )]= (cos )2 (sin )2= cos(2 )and the rotation angle is = 2 .It is important to note that the quaternionsqand qrepresent the same rotation since ( q) v( q) =q vq .While either Quaternion will do, the interpolation methods require choosing one over the Quaternion CalculusThe only support we need for Quaternion interpolation is to differentiate unit Quaternion functions raisedto a real-valued power. These formulas are identical to those derived in a standard Calculus course, but theorder of multiplication must be derivative of the functionqtwhereqis a constant unit Quaternion isddtqt=qtlog(q)(13)where log is the function defined earlier by log(cos + usin ) = u . To prove this, observe thatqt= cos(t ) + usin(t )in which caseddtqt= sin(t ) + ucos(t ) = u usin(t ) + ucos(t ) where we have used 1 = u u.

9 Factoring this, we haveddtqt= ( usin(t ) + cos(t )) u =qtlog(q)5 The right-hand side also factors as log(q)qt. Generally, the order of operands in a Quaternion multiplicationis important, but not in this special case. The power can be a function itself,ddtqf(t)=f (t)qf(t)log(q)(14)The method of proof is the same as that of the previous case wheref(t) = , a Quaternion function may be written asq(t) = cos( (t)) + u(t) sin( (t))(15)where the angle and uboth vary witht. The derivative isq (t) = sin( (t)) (t) + u(t) cos( (t)) (t) + u (t) sin( (t)) =q(t) u(t) (t) + u (t) sin( (t))(16)Because 1 = u(t) u(t), we also know that0 = u(t) u (t) + u (t) u(t)(17)If you write u=xi+yj+zkand expand the right-hand side of Equation (17), the equation becomesxx +yy +zz = 0.

10 This implies the vectorsu= (x,y,z) andu = (x ,y ,z ) are perpendicular. From thisdiscussion, it is easily shown that u(t)q (t) +q (t) u(t) = 2 (t)q(t)(18)Now defineh(t) =q(t)f(t)= cos(f(t) (t)) + u(t) sin(f(t) (t))(19)whereq(t) = cos( (t)) + u(t) sin( (t)). The motivation for the definition is that we know how to computeq(t)f(s)for independent variablessandt, and we want this to be jointly continuous in the sense thatq(t)f(t)= lims tq(t)f(s). The derivative ish (t) = [ sin(f ) + ucos(f )](f ) + u sin(f ) = ( uh)(f ) + u sin(f )(20)Similar to Equation (18), it may be shown that u(t)h (t) +h (t) u(t) = 2d[f(t) (t)]dth(t)Note that this last equation by itself is not enough information to completely determineh (t), so consider ita sufficient condition for the derivativeh (t).


Related search queries