Presentation is loading. Please wait.

Presentation is loading. Please wait.

Making a Point: Elementary (around Z?) Rotations in 2D …

Similar presentations


Presentation on theme: "Making a Point: Elementary (around Z?) Rotations in 2D …"— Presentation transcript:

1 Making a Point: Elementary (around Z?) Rotations in 2D …
r = |r| = |r1| = |r2| x1 = r cos a y1 = r sin a r is magnitude r = |r| r Rotation of coordinates Rotation of vector x2 y2 1 x1 y1 cos q - sin q sin q 0 cos q 0 = x2 y2 1 cos q sin q - sin q 0 cos q 0 = x1 y1 Notice the difference in their matrix representation!

2 Making a Point: Rotation Kinematics (ref. R.N. Jazar)
If the rigid body B attached to P rotates g degrees about the Z-axis of the Global frame G, then the coordinates of any point P of the rigid body in the local and global coordinate frames are related by the following equation Gr = RZ,g Br, that is: Gr = = Rz,aBr = cos g - sin g sin g 1 x y z X Y Z Similarly, a rotation of b degrees about the Y-axis, and a degrees about the X-axis of the global frame relate the local and global coordinates of point P by the following equations Gr = RY,b Br and Gr = RX,aBr respectively, that is: Gr = = RY,bBr = cos b sin b - sin b 1 x y z X Y Z and Gr = = RX,aBr = cos a - sin a sin a 1 x y z X Y Z

3 Computer exercise #4: Order of Rotations
Consider a point P(1, 2, 3) on rigid body B. (i) Find its global position after a rotation of 30 deg about the global X-axis followed by a rotation of 45 deg about the global Y-axis. (ii) Find its global position by changing the order of the rotations. (iii) Find how apart are they from each other. ANSWER: (i) (GrP)1 = cos 45 sin 45 - sin 45 1 cos 30 - sin 30 sin 30 2 3 = 3.2513 (ii) cos 45 sin 45 - sin 45 1 cos 30 - sin 30 sin 30 2 3 = 2.8284 1.0249 2.2247 (GrP)2 = The two positions are | | = sqrt(( )^2 + ( )^2 + ( )^2) = apart, that is: ROTATIONS ARE NOT COMMUTATIVE! (GrP)1 - (GrP)2

4 Take home computer exercise #A: Angle of the roll-pitch-yaw rotations
Consider the roll-pitch-yaw rotations by angles a , b and g around the X, Y and Z axes respectively. Find the general rotation matrix that represents the overall rotation matrix. For the inverse problem we say: “Given the global roll-pitch-yaw rotation matrix, determine the roll-pitch-yaw angles that took place. ANSWER: We have the following set of matrix products: GRB = RZ,g RY,b RX,a cos g - sin g sin g 1 GRB = cos b sin b - sin b cos a - sin a sin a cbcg = r11 cbcg casg + cgsasb sasg + cacgsb cbsg cacg + sasbsg -cgsa + casbsg -sb cbsa cacb r r r13 r r r33 r r r23 cbsg = r21 GRB = = -sb = r31 cbsa = r32 cbca = r33 The last set of 5 equalities, provided that cosb = sqrt((r11)2 + (r21)2) ≠ 0, yield: a = atan2(r32, r33) or atan(r32/r33) b = -asin(r31) g = atan2(r21,r11) or atan(r21/r11)

5 Computer exercise #5: Angle of the roll-pitch-yaw rotations
Consider the rotation matrix below. Determine the roll-pitch-yaw angles that took place. roll_angle = (180/pi)*atan2(r32, r33) pitch_angle = - (180/pi)* asin(r31) yaw_angle = (180/pi)* atan2(r21, r11) ANSWER: First notice that cosb = sqrt((r11)2 + (r21)2) = ≠ 0. Then we have: a = b = g =

6 Computer exercise #6: Rotation Kinematics (Cont’d)
Global rotation local position: Consider a point Q(4,3,2) (global coordinates) on rigid body B. Rotate Q by 60 degrees about the global Z axis. What was its initial position in the local coordinate system? Note: You must assume that the local coordinate system was coincident with the global coordinate system before rotation and thus we are just coming back to its initial “global” coordinates. ANSWER: It must be clear that we take the initial vector to Q in the global system. Then, we rotate Q around the global Z axis by 60 degrees and Q ends up at [4 3 2]t. That is, we have the relation RZ,60 * GrQ = [4 3 2]t, hence: GrQ = (RZ,60 )-1*[4 3 2]t, and thus: = x y z 4 3 2 cos 60 -sin sin cos 4.5981 2.0000 -1 cos sin -sin cos We found that the global coordinates of Q before rotation were [ ]t. Note: The inverse matrix of Rz,60 was obtained (as expected) by finding its transpose!

7 Exercise # 7: Repeated Rotations About The Global Axes
Successive global rotations, global position. Consider point P on a rigid body B as shown on the figure below (angle POY = 75o). P lies on the YZ plane (coordinate xP = 0). Therefore yP = 1*cos(75) = 0.26 & zP = 1*sin(75) = 0.97. Z Y P(0, y, z) X z y 1 O Rotate P -29 deg around the X-axis, then 30 deg about the Z-axis and lastly 132 degrees around the X-axis again. Find the new position of P. The overall rotation matrix will be: GRB = RX,132*RZ,30*RX,-29 . Executing the proper sequence we can find that GRB = 0.0 0.26 0.97 = -0.94

8 Repeated Rotations About The Global Axes
We turn a body frame about a global axis, say about the X-axis by g radians where g = 2*pi/n and then we repeat the rotation n times to return the body back to its initial configuration. We can check this process by multiplying RX,g by itself until we achieve an identity matrix. We have the following property for a matrix such as RX: (RX,g )m = cos mg - sin mg sin mg 1 = Making this matrix equal to the identity matrix (which occurs when m = n, g = 2p/n) it simply verifies that cos(2p) = 1 and sin(2p) = 0.

9 Exercise # 8: Repeated Rotations About The Global Axes
Repeated rotations around one axis: We turn a body frame about a global axis, say about the X-axis by 0.4 radians. How many times do we have to repeat this rotation to reach the closest angle to 125 degrees. Apply this rotation to vector v = [ ]t and find how close you are if you have rotated v by exactly 125 degrees (that is the distance between the two positions). ANSWER: In this case g = 0.4 radians and we need to determine m such that mg ≤ 125*p/180 => m =125*p/(0.4*180) = 5.45 = 5, that is the closest we can get to 125 degrees will be after 5 consecutive turns around the X-axis to an angle of mg = 5*0.4 = 2 radians = 2*180/pi = 0 cos –sin 0 sin cos 1.0 1.5 0.5 1.0000 1.1559 (RX,2 ) = = (RX,125) = 0 cos sin125 0 sin cos 125 = 1.0000 0.9419 1.0 1.5 0.5 distance = sqrt((1-1)^2 +( )^2+( )^2) =


Download ppt "Making a Point: Elementary (around Z?) Rotations in 2D …"

Similar presentations


Ads by Google