General N-Dimensional Rotations
Total Page:16
File Type:pdf, Size:1020Kb
General n-Dimensional Rotations Antonio Aguilera Ricardo Pérez-Aguila Centro de Investigación en Tecnologías de Información y Automatización (CENTIA) Universidad de las Américas, Puebla (UDLAP) Ex-Hacienda Santa Catarina Mártir México 72820, Cholula, Puebla [email protected] [email protected] ABSTRACT This paper presents a generalized approach for performing general rotations in the n-Dimensional Euclidean space around any arbitrary (n-2)-Dimensional subspace. It first shows the general matrix representation for the principal n-D rotations. Then, for any desired general n-D rotation, a set of principal n-D rotations is systematically provided, whose composition provides the original desired rotation. We show that this coincides with the well-known 2D and 3D cases, and provide some 4D applications. Keywords Geometric Reasoning, Topological and Geometrical Interrogations, 4D Visualization and Animation. 1. BACKGROUND arctany x x 0 arctany x x 0 The n-Dimensional Translation arctan2(y, x) 2 x 0, y 0 In this work, we will use a simple nD generalization of the 2D and 3D translations. A point 2 x 0, y 0 x (x1 , x2 ,..., xn ) can be translated by a distance vec- In this work we will only use arctan2. tor d (d ,d ,...,d ) and results x (x, x ,..., x ) , 1 2 n 1 2 n 2. INTRODUCTION which, can be computed as x x T (d) , or in its expanded matrix form in homogeneous coordinates, The rotation plane as shown in Eq.1. [Ban92] and [Hol91] have identified that if in the 2D space a rotation is given around a point, and in the x1 x2 xn 1 3D space it is given around a line, then in the 4D space, in analogous way, it must be given around a 1 0 0 0 plane. 0 1 0 0 (Eq. 1) x1 x2 xn 1 [Hol91] considers that rotations in 3D space must be 0 0 1 0 considered as rotations parallel to a 2D plane instead of rotations around an axis. [Hol91] supports this d d d 1 1 2 n idea considering that given an origin of rotation and a destination point in the 3D space, the set of all The arctan2 function rotated points for a given rotation matrix lie in a If tan( ) m , then arctan(m) . Moreover, if we single plane, which is called the rotation plane. know that tan( ) y x , then a better well-known Moreover, the rotation axis in the 3D space coincides with the normal vector of the rotation plane. The solution is arctan2( y, x) , where concept of rotation plane is consistent with the 2D space because all the rotated points lie in the same Permission to make digital or hard copies of all or part of and only plane. Finally, with the above ideas, this work for personal or classroom use is granted without [Hol91] constructs all six basic 4D rotation matrices fee provided that copies are not made or distributed for around the main planes in 4D space. profit or commercial advantage and that copies bear this notice and the fill citation on the first page. To copy Main n-Dimensional Rotations otherwise, or republish, to post on servers or to redistribute We know that in the 3D space, rotations are defined to lists, requires prior specific permission and/or a fee. in terms of the axis around they take place. However, we know that it is more appropriate to consider that WSCG SHORT Communication papers proceedings WSCG'2004, February 2-6, 2004, Plzen, Czech Republic. 3D rotations take place in a plane embedded in the Copyright UNION Agency - Science Press 3D space (the plane’s normal vector coincides with the rotation axis). Using these ideas, [Duf94] genera- View metadata, citation and similar papers at core.ac.uk brought to you by CORE provided by DSpace at University of West Bohemia lizes the concept of a main rotation in an nD space key points that will be very useful when extending (n 2) as the rotation of an axis Xa in direction to an them to the nD case. Moreover, the 3D case will be presented in a way that facilitates its generalization axis Xb. The plane described by axis Xa and Xb is to nD. what [Hol91] defined as rotation plane. [Duf94] pre- sents the following general matrix for main rotations: General 2D Rotations ra,a cos( ) Since the main 2D rotation R1,2 is around the origin, r cos( ) b,b a general rotation of an angle around a fixed point ra,b sin( ) a (a1,a2 ) can be obtained by the following Ra,b ( ) ri, j r sin( ) composition: , which is b,a x x T( a) R1,2 ( ) T(a) rj, j 1, j a, j b expanded as shown in Eq. 2 Note that the inverse r 0 elsewhere matrix of T (a) is T (a) . i, j For an n-dimensional rotation, this is an n n matrix, General 3D Rotations or an (n 1) (n 1) matrix if homogeneous A general 3D rotation is a rotation of an angle coordinates are used. It can easily be verified that in around a general axis. This axis, in this work, will be represented by the supporting line of the directed the 2D space, R1,2 corresponds to the positive segment S ab (a 1D simplex), where (counter clockwise) rotation around the origin, while (0) (0) (0) (0) (0) (0) a (a1 ,a2 ,a3 ) and b (b1 ,b2 ,b3 ) are two R2,1 corresponds to the negative (clockwise) rotation non-coincident 3D points which we will refer as the 1 around the origin, moreover . Similarly in R1,2 R2,1 vertices of S. See Fig 1.(i). The positive direction of the 3D space, R1,2 , R2,3 and R3,1 respectively the rotation is given by the right hand rule (pointing with your right thumb from a to b, the remaining four correspond to a positive rotation around axes X , X , 3 1 curved fingers describe the positive direction). This and X (ie., axes Z, X, and Y) while the 2 rotation can be achieved as the composition of a corresponding negative rotations are R , R and 2,1 3,2 number of transformations, which firstly aligns R1,3 , which, by the way, are the corresponding segment S with any of the main axis, secondly performs the desired rotation around that main axis, inverse matrices of R1,2 , R2,3 and R3,1 . and thirdly returns the rotation axis to its original Observation 1. Matrix Ra,b ( ) is almost an identity position by performing the inverse of those transformations in reverse order. matrix except in the intersection of columns a and b (0) (0) (0) with rows a and b, which means that only the (0) a1 a2 a3 Let v be the matrix for the coordinates a and b of a point will change after a (0) (0) (0) b1 b2 b3 Ra,b ( ) rotation, which is consistent with the 3D and original vertices’ coordinates, let M k be the 2D cases. corresponding matrix for the k th transformation. n (0) (1) (2) (k ) (k 1) Observation 2. Since there are C main planes in Then v , v , v ,..., where v v M k , is a 2 series of matrices holding the vertices coordinates at a nD space, this is precisely the number of main (k ) (k ) (k ) (k ) a1 a2 a3 rotations for such space. each step, v , or simply (k ) (k ) (k ) b1 b2 b3 Observation 3. Let ek (1 k n) be the unit vector (k ) (k ) a along axis Xk, in the nD space, then . v (k ) b ea Ra,b ( / 2) eb , i.e., Ra,b moves a point on Xa towards Xb. In this work, the chosen main axis where the segment 3. FROM MAIN TO GENERAL S will be directed to, is X1. The first step is to move point a to the origin, therefore, M T (a) ROTATIONS 1 (1) 0 0 0 which makes Although the following discussions can be found in v (1) (1) (1) b b b any text book (see Hearn & Baker [Hea96] for 1 2 3 (1) (0) (0) example), they are included here to underline some where b b a , j 1,2,3. See Fig. 1.(ii). j j j 1 0 0 cos( ) sin( ) 0 1 0 0 (Eq. 2) x x 1 x x 1 0 1 0 sin( ) cos( ) 0 0 1 0 1 2 1 2 a1 a2 1 0 0 1 a1 a2 1 i) ii) x x M , where M M M M M M M M X2 X2 1 2 3 4 5 6 7 and it is usually computed in advance. b General 4D Rotations a A general 4D rotation is a rotation of an angle X1 X1 around a general plane. This plane, in this work, will be represented by the supporting plane of a triangle T abc (a 2D simplex), where X3 X3 (0) (0) (0) (0) (0) (0) (0) (0) a (a1 ,a2 ,a3 ,a4 ) , b (b1 ,b2 ,b3 ,b4 ) and (0) (0) (0) (0) X2 X2 c (c1 ,c2 ,c3 ,c4 ) are three non-collinear 4D points which we will refer as the vertices of T. This rotation can be achieved as the composition of a number of transformations, which firstly takes X1 triangle T onto main plane X1X2, so that edge ab of T X1 is aligned with axis X1, secondly it performs the desired rotation around main plane X1X2, and thirdly it returns triangle T to its original position by X3 iii) X3 iv) performing the inverse of those transformations in Figure 1.