ebook img

Anti-commutative Dual Complex Numbers and 2D Rigid Transformation PDF

3.5 MB·
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Anti-commutative Dual Complex Numbers and 2D Rigid Transformation

ANTI-COMMUTATIVE DUAL COMPLEX NUMBERS AND 2D RIGID TRANSFORMATION GENKIMATSUDA,SHIZUOKAJI†,ANDHIROYUKIOCHIAI Abstract. Weintroduceanewpresentationofthetwodimensionalrigid transformationwhichismoreconciseandefficientthanthestandardma- 6 trix presentation. By modifying the ordinary dual number construction 1 for the complex numbers, we define the ring of the anti-commutative 0 dualcomplexnumbers,whichparametrizestwodimensionalrotationand 2 translation all together. With this presentation, one can easily interpo- n late or blend two or more rigid transformations at a low computational a cost.WedevelopedalibraryforC++withtheMIT-licensedsourcecode J ([13])anddemonstrateitsfacilitybyaninteractivedeformationtoolde- 8 velopedforiPad. ] R 1. RigidTransformation G . The n-dimensional rigid transformation (or Euclidean) group E(n) con- s c sists of transformations of Rn which preserves the standard metric. This [ group serves as an essential mathematical backend for many applications 1 (see[2,9]). Itiswell-known(see[6],forexample)thatanyelementofE(n) v 4 canbewrittenasacompositionofarotation,areflection,andatranslation, 5 andhence,itisrepresentedby(n+1)×(n+1)-homogeneousmatrix; 7 (cid:40) (cid:32) (cid:33) (cid:41) 1 Aˆ d 0 E(n) = A = A | AˆtAˆ = I ,d ∈ Rn . 0 1 n A . 1 0 Here, we adopt the convention that a matrix acts on a (column) vector by 6 the multiplication from the left. E(n) has two connected components. The 1 identity component SE(n) consists of those without reflection. More pre- : v cisely, i (cid:40) (cid:32) (cid:33) (cid:41) X Aˆ d SE(n) = A = A | Aˆ ∈ SO(n),d ∈ Rn , r 0 1 A a where SO(n) = {R | RtR = I ,det(R) = 1} is the special orthogonal group n composedofn-dimensionalrotations. The group SE(n) is widely used in computer graphics such as for ex- pressing motion and attitude, displacement ([10]), deformation ([1, 5, 11]), skinning ([8]), and camera control ([3]). In some cases, the matrix repre- sentation of the group SE(n) is not convenient. In particular, a linear com- bination of two matrices in SE(n) does not necessarily belong to SE(n) and Key words and phrases. 2D rigid transformation, 2D Euclidean transformation, dual numbers,dualquaternionnumbers,dualcomplexnumbers,deformation. †Correspondingauthor. 1 2 GENKIMATSUDA,SHIZUOKAJI†,ANDHIROYUKIOCHIAI it causes the notorious candy-wrapper defect in skinning. When n = 3, an- otherrepresentationofSE(3)usingthedualquaternionnumbers(DQN,for short) is considered in [8] to solve the candy-wrapper defect. In this paper, we consider the 2-dimensional case. Of course, 2D case can be handled by regarding the plane embedded in R3 and using DQN, but instead, we intro- duce the anti-commutative dual complex numbers (DCN, for short), which isspecificto2Dwithmuchmoreconciseandfasterimplementation([13]). Tosummarise,ourDCNhasthefollowingadvantages: • any number of rigid transformations can be blended/interpolated easilyusingitsalgebraicstructurewithnodegenerationdefectssuch asthecandy-wrapperdefect(see§5) • itisefficientintermsofbothmemoryandCPUusage(see§6). WebelievethatourDCNoffersachoiceforrepresentingthe2Drigidtrans- formationincertainapplicationswhichrequirestheaboveproperties. 2. Anti-commutativedualcomplexnumbers Let K denote one of the fields R,C, or H, where H is the quaternion numbers. First, we recall the standard construction of the dual numbers overK. Definition2.1. TheringofdualnumbersKˆ isthequotientringdefinedby Kˆ := K[ε]/(ε2) = {p + p ε | p ,p ∈ K}. 0 1 0 1 WeoftendenoteanelementinKˆ byasymbolwithhatsuchas pˆ. Theadditionandthemultiplicationoftwodualnumbersaregivenas (p + p ε)+(q +q ε) = (p +q )+(p +q )ε, 0 1 0 1 0 0 1 1 (p + p ε)(q +q ε) = (p q )+(p q + p q )ε. 0 1 0 1 0 0 1 0 0 1 Thefollowinginvolutionisconsideredtobethedualversionofconjuga- tion p(cid:93)+ p ε := p∗ − p∗ε, 0 1 0 1 where p∗ is the usual conjugation of p in K. (Note that in some literatures i i p˜ˆ isdenotedby pˆ∗.) Theunitdualnumbersareofspecialimportance. (cid:113) Definition 2.2. Let |pˆ| = pˆp˜ˆ for pˆ ∈ Kˆ. The unit dual numbers is defined as Kˆ := {pˆ ∈ Kˆ | |pˆ| = 1} ⊂ Kˆ. 1 Kˆ actsonKˆ byconjugationaction 1 pˆ (cid:5)qˆ := pˆqˆp˜ˆ where pˆ ∈ Kˆ ,qˆ ∈ Kˆ. 1 ANTI-COMMUTATIVEDUALCOMPLEXNUMBERSAND2DRIGIDTRANSFORMATION3 The unit dual quaternion Hˆ is successfully used for skinning in [8]; a 1 vector v = (x,y,z) ∈ R3 is identified with 1+(xi+yj+zk)ε ∈ Hˆ and the 1 conjugationactionofHˆ preservestheembeddedR3 anditsEuclideanmet- 1 ric. Infact,theconjugationactioninducesthedoublecoverHˆ → SE(3). 1 On the other hand, when K = R or C, the conjugation action is triv- ial since the corresponding dual numbers are commutative. Therefore, we define the anti-commutative dual complex numbers (DCN, for short) Cˇ by modifyingthemultiplicationofCˆ. Thatis,Cˇ = Cˆ asaset,andthealgebraic operationsarereplacedby (p + p ε)(q +q ε) = (p q )+(p q˜ + p q )ε, 0 1 0 1 0 0 1 0 0 1 p(cid:93)+ p ε = p˜ + p ε, 0 1 0 1 |p + p ε| = |p |. 0 1 0 Theadditionandtheconjugationactionarekeptunchanged. Then, Theorem 2.3. Cˇ satisfies distributive and associative laws, and hence, has a(non-commutative)ringstructure. Similarlytotheunitdualquaternionnumbers,theunitanti-commutative complexnumbersareofparticularimportance: Cˇ := {pˆ ∈ Cˇ | |pˆ| = 1} = {eiθ + p ε ∈ Cˇ | θ ∈ R,p ∈ C}. 1 1 1 Itformsagroupwithinverse (eiθ + p ε)−1 = e−iθ − p ε. 1 1 WedefineanactionofCˇ onCˇ bytheconjugation. Now,weregardC = R2 1 as usual. Identifying v ∈ C with 1 + vε ∈ Cˇ, we see that Cˇ acts on C as 1 rigidtransformation. 3. RelationtoSE(2) In the previous section, we constructed the unit anti-commutative dual complex numbers Cˇ and its action on C = R2 as rigid transformation. 1 Recallthat pˆ = p + p ε ∈ Cˇ actsonv ∈ Cby 0 1 1 (3.1) pˆ (cid:5)(1+vε) = (p + p ε)(1+vε)(p˜ + p ε) = 1+(p2v+2p p )ε, 0 1 0 1 0 0 1 thatis,vmapsto p2v+2p p . Forexample,when p = 0,v ∈ Cismapped 0 0 1 1 to p2v, which is the rotation around the origin of degree 2arg(p ) since 0 0 |p | = 1. On the other hand, when p = 1, the action corresponds to the 0 0 translationby2p . Ingeneral,wehave 1 ϕ : Cˇ → SE(2) 1   Re(p2) −Im(p2) Re(2p p ) p0 + p1ε (cid:55)→ Im(p020) Re(p200) Im(2p00p11), 0 0 1 4 GENKIMATSUDA,SHIZUOKAJI†,ANDHIROYUKIOCHIAI where Re(2p p ) (respectively, Im(2p p )) is the real (respectively, imagi- 0 1 0 1 nary) part of 2p p ∈ C. Note that this gives a surjective group homomor- 0 1 phism ϕ : Cˇ → SE(2) whose kernel is {±1}. That is, the preimage of any 1 2D rigid transformation consists of exactly two unit DCN’s with opposite signs. Example 3.1. We compute the DCN’s ±pˆ ∈ Cˇ which represent θ-rotation 1 around v ∈ C. It is the composition of the following three rigid transfor- mations: (−v)-translation, θ-rotation around the origin, and v-translation. Thus,wehave (cid:18) v (cid:19) (cid:16) (cid:17) (cid:18) v (cid:19) (cid:18) (cid:16) (cid:17) v (cid:19) pˆ = 1+ ε · ±e2θi · 1− ε = ± e2θi + e−2θi −e2θi ε . 2 2 2 4. Relationtothedualquaternionnumbers Thefollowingringhomomorphism Cˇ (cid:51) p + p ε (cid:55)→ p + p jε ∈ Hˆ 0 1 0 1 is compatible with the involution and the conjugation, and preserves the norm. Furthermore, if we identify v = (x,y) ∈ R2 with 1 + (xj + yk)ε (= 1 + (x + yi)jε), the above map commutes with the action. From this point ofview,DCNisnothingbutasub-ringofDQN. Note also that Cˇ can be embedded in the ring of the 2×2-complex ma- tricesby (cid:32) (cid:33) p p p + p ε (cid:55)→ 0 1 . 0 1 0 p˜ 0 Then (cid:32) (cid:93) (cid:33) (cid:32) (cid:33) (cid:12)(cid:12)(cid:32) (cid:33)(cid:12)(cid:12)2 (cid:32) (cid:33) p p p˜ p (cid:12) p p (cid:12) p p 0 1 = 0 1 , (cid:12) 0 1 (cid:12) = det 0 1 . 0 p˜0 0 p0 (cid:12)(cid:12) 0 p˜0 (cid:12)(cid:12) 0 p˜0 WethushavevariousequivalentpresentationsofDCN.However,ourpre- sentationofCˇ astheanti-commutativedualnumbersiseasiertoimplement andmoreefficient. 5. Interpolationof2Drigidtransformations First, recall that for the positive real numbers x,y ∈ R , there are two >0 typicalinterpolationmethods: (1−t)x+ty, t ∈ R and (yx−1)tx, t ∈ R. ThefirstmethodcanbegeneralizedtoDQNastheDualquaternionLin- ear Blending in [8]. Similarly, a DCN version of Dual number Linear Blending(DLB,forshort)isgivenasfollows: ANTI-COMMUTATIVEDUALCOMPLEXNUMBERSAND2DRIGIDTRANSFORMATION5 Definition5.1. For pˆ ,pˆ ,...,pˆ ∈ Cˇ ,wedefine 1 2 n 1 w pˆ +w pˆ +···+w pˆ (5.1) DLB(pˆ ,pˆ ,...,pˆ ;w ,w ,...,w ) = 1 1 1 2 n n , 1 2 n 1 2 n |w pˆ +w pˆ +···+w pˆ | 1 1 1 2 n n where w ,w ,...,w ∈ R. Note that the denominator can become 0 and for 1 2 n thosesetofw’sand pˆ ’sDLBcannotbedefined. i i A significant feature of DLB is that it is distributive (it is called bi- invariantinsomeliteratures). Thatis,thefollowingholds: pˆ DLB(pˆ ,pˆ ,...,pˆ ;w ,w ,...,w ) = DLB(pˆ pˆ ,pˆ pˆ ,...,pˆ pˆ ;w ,w ,...,w ). 0 1 2 n 1 2 n 0 1 0 2 0 n 1 2 n This property is particularly important when transformations are given in a certain hierarchy such as in the case of skinning; if the transformation assigned to the root joint is modified, the skin associated to lower nodes is deformedconsistently. Next,weconsidertheinterpolationofthesecondtype. Forthis,weneed theexponentialandthelogarithmmapsforDCN. Definition5.2. For pˆ = p + p ε ∈ Cˇ,wedefine 0 1 (cid:88)∞ (p + p ε)n (ep0 −ep˜0) exppˆ = 0 1 = ep0 + p ε. n! p − p˜ 1 n=0 0 0 Whenexppˆ ∈ Cˇ ,wecanwrite p = θiforsome−π ≤ θ < π,and 1 0 sinθ exppˆ = eθi + p ε. 1 θ Forqˆ = eθi +q ε ∈ Cˇ ,wedefine 1 1 θ log(qˆ) = θi+ q ε. 1 sinθ Asusual,wehaveexp(log(qˆ)) = qˆ andlog(exp(pˆ)) = pˆ. Notethatthisgives thefollowingLiecorrespondence(see[4,2,9]) exp : dcn → Cˇ , 1 log : Cˇ → dcn, 1 where dcn = {θi + p ε ∈ Cˇ | θ ∈ R,p ∈ C} (cid:39) R3. We have the following 1 1 commutativediagram: dcn dϕ (cid:47)(cid:47) se(2) exp exp (cid:15)(cid:15) (cid:15)(cid:15) Cˇ ϕ (cid:47)(cid:47) SE(2), 1 where dϕ : dcn → se(2)   0 −2θ 2x θi+(x+yi)ε (cid:55)→ 2θ 0 2y, 0 0 0 6 GENKIMATSUDA,SHIZUOKAJI†,ANDHIROYUKIOCHIAI isanisomorphismofR-vectorspaces. ThefollowingisaDCNversionofSLERP[12]. Definition5.3. SLERPinterpolationfrom pˆ ∈ Cˇ toqˆ ∈ Cˇ isgivenby 1 1 SLERP(pˆ,qˆ;t) = (qˆpˆ−1)tpˆ = exp(tlog(qˆpˆ−1))pˆ, wheret ∈ R. This gives a uniform angular velocity interpolation of two DCN’s, while DLB can blend three or more DCN’s without the uniform angular velocity property. 6. Computationalcost Wecomparethefollowingfourmethodsfor2Drigidtransformation: our DCN, the unit dual quaternion numbers (see §4), the 3 × 3-real (homo- geneous) matrix representation of SE(2), and the 2 × 2-complex matrices describedbelow. We list the computational cost in terms of the number of floating point operationsfor • transformingapoint • composingtwotransformations • converting a transformation to the standard 3×3-real matrix repre- sentation (except for the 3 × 3-real matrix case where it shows the computationalcosttoconverttoDCNrepresentation). Wealsogivethememoryusageforeachpresentationintermsofthenumber offloatingpointunitsnecessarytostoreatransformation. transformation composition conversion memoryusage DCN 22FLOPs 20FLOPs 15FLOPs 4scalars DQN 92FLOPs 88FLOPs NA 8scalars 2×2-complexmatrix 112FLOPs 56FLOPs 15FLOPs 8scalars 3×3-realmatrix 15FLOPs 45FLOPs 18FLOPs(toDCN) 9scalars Table1. Comparisonofcomputationalcost Note that when a particular application requires to apply a single trans- formationtoalotofpoints,itisfastertofirstconverttheDCNtoa3×3-real matrix. 7. AC++Library WeimplementedourDCNinaformofC++library. Thoughitiswritten in C++, it should be easy to translate to any language. You can down- load the MIT-licensed source code at [13]. We also developed a small demo application called the 2D probe-based deformer ([7]) for tablet de- vices running OpenGL ES (OpenGL for Embedded Systems). Thanks to the efficiency of DCN and touch interface, it offers interactive and intuitive ANTI-COMMUTATIVEDUALCOMPLEXNUMBERSAND2DRIGIDTRANSFORMATION7 operation. Although we did not try, we believe DCN works well with 2D skinningjustasDQNdoeswith3Dskinning. Figure 1. Left: set up initial positions of (blue) probes. Right: the target picture is deformed according to user’s ac- tionontheprobes. Herewebrieflydiscussthealgorithmoftheapplication. Onecanplacean arbitrarynumberofprobesP ,...,P onatargetimage. Thetargetimageis 1 n represented by a textured square mesh with vertices v ,...,v . The weight 1 m w of P’s effect on v is painted by user or automatically calculated from ij i j the distance between v and P. When the probes are rotated or translated j i bytheuser’stouchgesture,theDCN pˆ iscomputedwhichmapstheinitial i stateof P toitscurrentstate. Thevertexv istransformedby i j v (cid:55)→ DLB(pˆ ,pˆ ,...,pˆ ;w ,w ,...,w )(cid:5)v . j 1 2 n 1j 2j nj j (SeeEquations(3.1)and(5.1)respectivelyforthedefinitionoftheaction(cid:5) andDLB.) Acknowledgements This work was supported by Core Research for Evolutional Science and Technology (CREST) Program “Mathematics for Computer Graphics” of JapanScienceandTechnologyAgency(JST).TheauthorsaregratefulforS. 8 GENKIMATSUDA,SHIZUOKAJI†,ANDHIROYUKIOCHIAI Hirose at OLM Digital Inc., and Y. Mizoguchi, S. Yokoyama, H. Hamada, andK.MatsushitaatKyushuUniversityfortheirvaluablecomments. References [1] M. Alexa, D. Cohen-Or, and D. Levin, As-rigid-as-possible shape interpolation, In Proceedingsofthe27thannualconferenceonComputergraphicsandinteractivetech- niques (SIGGRAPH ’00). ACM Press/Addison-Wesley Publishing Co., New York, NY,USA,157–164.DOI=10.1145/344779.344859. [2] K.AnjyoandH.Ochiai,Mathematicalbasicsofmotionanddeformationincomputer graphics,SynthesisLecturesonComputerGraphicsandAnimation6,3,1–83,2014. [3] M. Gleicher and A. Witkin, Through-the-lens camera control, SIGGRAPH Comput. Graph.26,2(July1992),331–340.DOI=10.1145/142920.134088. [4] J. E. Humphreys, Introduction to Lie Algebras and Representation Theory, Second printing,revised.GraduateTextsinMathematics,9.Springer-Verlag,NewYork,1978. [5] T.Igarashi,T.Moscovich,andJ.F.Hughes,As-rigid-as-possibleshapemanipulation, InACMSIGGRAPH2005Papers(SIGGRAPH’05),MarkusGross(Ed.).ACM,New York,NY,USA,1134–1141.DOI=10.1145/1186822.1073323. [6] J.Jeffers,LostTheoremsofGeometry,TheAmericanMathematicalMonthlyVol.107, No.9,pp.800–812,2000. [7] S.KajiandG.Liu,Probe-typedeformers,MathematicalProgressinExpressiveImage SynthesisII,Springer-Japan,63–77,2015. [8] L. Kavan, S. Collins, J. Zara, C. O’Sullivan. Geometric Skinning with Approximate DualQuaternionBlending.ACMTransactiononGraphics,2008,27(4),105. [9] H.Ochiai,andK.Anjyo,MathematicalDescriptionofMotionandDeformation,SIG- GRAPHAsia2013Course,http://portal.acm.org,2013.(Revisedcoursenotes arealsoavailableathttp://mcg.imi.kyushu-u.ac.jp/english/index.php) [10] S. Pinheiro, J. Gomes, and L. Velho, Interactive Specification of 3D Displacement Vectors Using Arcball, In Proceedings of the International Conference on Computer Graphics(CGI’99).IEEEComputerSociety,Washington,DC,USA,70. [11] S. Schaefer, T. McPhail, and J. Warren, Image deformation using moving least squares,InACMSIGGRAPH2006Papers(SIGGRAPH’06).ACM,NewYork,NY, USA,533–540.DOI=10.1145/1179352.1141920. [12] K. Shoemake, Animating rotation with quaternion curves, ACM SIGGRAPH, pp. 245–254,1985. [13] https://github.com/KyushuUniversityMathematics/iPad-ProbeDeformer KyushuUniversity/JSTCREST E-mailaddress: [email protected] YamaguchiUniversity/JSTCREST E-mailaddress,Correspondingauthor: [email protected] KyushuUniversity/JSTCREST E-mailaddress: [email protected]

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.