Linear Transformations Exercises#

Exercise 10

A linear transformation \(T: \mathbb{R}^3 \to \mathbb{R}^3\) is defined by \(T(x,y,z) = (x + 2y - z, 3x + z, 2x - y + 3z)\). Determine the transformation matrix for \(T\) and use it to calculate \(T(2, 5, 1)\).

Exercise 11

\(T: \mathbb{R}^3 \to \mathbb{R}^3\) is a linear transformation such that

\[\begin{split} \begin{align*} T\begin{pmatrix} 1 \\ -1 \\ 0 \end{pmatrix} &= \begin{pmatrix} 1 \\ -2 \\ -4 \end{pmatrix}, & T\begin{pmatrix} 0 \\ 1 \\ 2 \end{pmatrix} &= \begin{pmatrix} 6 \\ 5 \\ 10 \end{pmatrix}, & T\begin{pmatrix} -1 \\ 1 \\ 1 \end{pmatrix} &= \begin{pmatrix} 2 \\ 4 \\ 7 \end{pmatrix}. \end{align*} \end{split}\]

Find the transformation matrix for \(T\).

Exercise 12

An equilateral triangle is defined in \(\mathbb{R}^2\) is centered \((3, 2)\) at the origin with side lengths 2 and with one side parallel to the \(x\)-axis. The triangle is to be translated by the translation vector \(\mathbf{t} = (3, 1)\).

(a) determine the co-ordinates off the three vertices of the triangle before the translation has been applied;

(b) determine the transformation matrix for the translation;

(c) using MATLAB, calculate the vertex co-ordinates of the translated triangle;

(d) plot the pre and post-translated triangle on the same axes.

Exercise 13

The translated triangle from Exercise 12 is scaled by a factor of 0.5 in both directions. In MATLAB, calculate the vertex co-ordinates of the scaled triangle and produce a plot showing the pre and post scaled triangle on the same axes.

Exercise 14

The translated triangle from Exercise 12 is rotated by \(\theta=\pi/4\) anti-clockwise about its centre. In MATLAB, calculate the vertex co-ordinates of the rotated triangle and produce a plot showing the pre and post rotated triangle on the same axes.

Exercise 15

The MATLAB code below produces a 5 second animation of a point \(\mathbf{p}\) travelling in a circular arc centred at \((10,10)\) with radius 8. The point performs one full rotation per second.

% Define arc parameters
c = [10 ; 10];
r = 8;

% Loop through animation frames
fps = 60;
for t = 0 : 1/fps : 5

    % Calculate point position
    phi = t * 2 * pi;
    p = c + r * [cos(phi) ; sin(phi)];

    % Plot point
    clf
    plot(p(1), p(2), 'bo', MarkerFaceColor='b')
    axis equal
    axis([0, 20, 0, 20])
    title(sprintf('time = %1.2f s', t))
    xlabel('$x$', FontSize=12, Interpreter='latex')
    ylabel('$y$', FontSize=12, Interpreter='latex')
    box on
    drawnow
end

Copy this code into a MATLAB live script and edit it so that it does the following:

(a) animate a square with side lengths 1 travelling with a centre at \(\mathbf{p}\). (Hint: define the square vertices so it is centred at the origin);

(b) the square from part (a) is scaled by the scaling vector \(\mathbf{s} = (2+\cos(5t), 2+\cos(5t))\) about its centre;

(c) the square rotates in an clockwise direction about its centre so that the square performs 8 rotations per second.

Exercise 16

A set of co-ordinates is to be rotated by \(\theta=\pi/6\) anti-clockwise about the line that passes through the point \((2, -4, -3)\) and has the direction vector \((-2, 3, 4)\). Determine the individual transformation matrices used to perform this rotation and write down an expression for calculating a single composite transformation matrix.