Professional Documents
Culture Documents
EL424
LABORATORY MANUAL
Spring 2018
LAB 06
Rotation Mtrices on MATLAB
Engr. Iqra Akram
______________________________________
LAB ENGINEER SIGNATURE & DATE
1. Learning Objectives:
a. Understanding of rotational matrix in 3D.
b. Understanding of rotation of vector in space.
2. Equipment Required:
MATLAB
PC
3. Introduction
We can rotate the frame in space in which we have to define 3 angles one is along x-axis, one is
along y-axis and one is along z-axis.At the end we will pick the vector in space and rotate along
different axis. Rotation matrices are used to rotate a vector into a new direction.
In transforming vectors in three-dimensional space, rotation matrices are often encountered.
Rotation matrices are used in two senses: they can be used to rotate a vector into a new position
or they can be used to rotate a coordinate basis (or coordinate system) into a new one. In this
case, the vector is left alone but its components in the new basis will be different from those in
the original basis. In Euclidean space, there are three basic rotations: one each around the x, y
and z axes. Each rotation is specified by an angle of rotation. The rotation angle is defined to be
positive for a rotation that is counterclockwise when viewed by an observer looking along the
rotation axis towards the origin. Any arbitrary rotation can be composed of a combination of
these three (Euler's rotation theorem)
For exapmle :
Rotation Matrix:
Rotation along Z-axis:
Rotation Matrix:
R = rotx(ang) creates a 3-by-3 matrix used to rotated a 3-by-1 vector or 3-by-N matrix of vectors
around the x-axis by angdegrees. When acting on a matrix, each column of the matrix represents
a different vector. For the rotation matrix R and vectorv, the rotated vector is given by R*v.
Task 1:
Rotate the frame along X-axis, y-axis and z-axis by 90˚
a) Using MATLAB
1- In clockwise
2- In counter clockwise
MATLAB code:
b) On paper
Task 2:
Find the rotationa matrix R=RZRYRX from task 1 and rotate the vector [1,1,1] along the
space.
c) Using MATLAB
1- In clockwise
MATLAB code:
MATLAB command Window:
2- On paper
Task 3:
a) You have to find the rotation matrix R of the following case. In which there are
number of possibility to go from (a) frame to (b). Use only two possibilties of angle
α, β and γ to go from (a) frame to (b)
1- Using MATLAB
2- On paper
b)
Use rotation matrix R=RZRYRX from task 3 and rotate the vector [1,1,1] along the space
Task 4:
.
MATLAB code:
Student's feedback:[Separate this page; fill it; drop in the Drop Box.]
Providing feedback for every lab session is optional. No feedback means you are satisified
The Lab Committee will consider only duly filled forms submitted within one week after the
lab
This feedabck is for LAB session: LAB Number: _____, Date: _____________________
General (to provide feedback on a persistent practice/ocurrence in LABs).
Your current CGPA is in the range 4.00 to 3.00/2.99 to 2.00/1.99 to 1.00/0.99 to 0.00