The (4x4) "homogeneous transformation matrix" describes a position and orientation in three space. This representation can be applied to describing and manipulating the position and orientation of a robot arm, hence it is a topic covered in detail in EE4353. The same mathematics finds applications in computer graphics, as shown here.
The "rotation-by-theta about the x-axis" transformation matrix can be derived in MATLAB by creating a simple function ROTX( theta ). This is accomplished by building a new function rotx.m defined as:
% rotx - returns the htm representing this transformation function [htm] = rotx( theta ) st = sin(theta); ct = cos(theta); htm = [ 1,0,0,0;0,ct,-st,0;0,st,ct,0;0,0,0,1];
Similarly, functions can be defined for rotations about the other axes. It would be very useful to define your own library of functions for manipulating objects in this way.
The transformations for the above diagram are then given directly by:
EDU>> ROTx( pi/4 ) * ROTy( -pi/4 ) ans = 0.7071 0 -0.7071 0 -0.5000 0.7071 -0.5000 0 0.5000 0.7071 0.5000 0 0 0 0 1.0000 EDU>>
Applying this to the corner point (1,1,1) on the original cube (the cube is 2 units on each side and centered on the origin.) yields:
EDU>> rotx(pi/4) * roty(-pi/4) * [1,1,1,1]' ans = 0.0000 -0.2929 1.7071 1.0000 EDU>>
This vertex is now found at the uppermost point on the above figure. The above result is consistent with the observation that this point appears to lie 0.29 units away from the z-axis and immediately above the x-axis.
The homogeneous transformation matrix is a powerful tool for manipulating three dimensional objects.
22 Jan 02 - firstname.lastname@example.org
University of New Brunswick, Department of Electrical and Computer Engineering