random
random
Lab Assignment # 3
Linear Transformations
Objective
The primary goal of this lab is to explore compositions of linear transformations in and
understand their sequential effects through visualization. By applying two linear trans-
formations sequentially and analyzing their composition, we develop an intuition about
how these transformations alter geometrical structures in vector spaces.
1 Setup
This section explains the algorithm, the simulation setup, and the syntax of the key
MATLAB functions used to implement and visualize compositions of linear transforma-
tions.
1.1 Algorithm
The algorithm involves applying linear transformations sequentially on an input vector
space R2 and visualizing the effects.
• Apply transformations sequentially and plot the results after each stage.
4. Visualization
3. Transformation Matrices
We apply the given transformation matrices individually and in sequence (compo-
sition).
4. Plotting Strategy
The visualizations are created using MATLAB’s plotting functions:
5. Subplots
Subplots are used to display different stages of transformation within a single figure
for easy comparison.
x_range = -2:1:3;
y_range = -2:1:3;
[X, Y] = meshgrid(x_range, y_range);
• Apply transformation
• Plot transformed lines
1.6 Summary
The setup uses matrix multiplication to apply linear transformations to a grid rep-
resenting the vector space. MATLAB functions like meshgrid(), plot(), and subplot()
make visualization clear and intuitive. The sequence of transformations and their effects
are displayed in multiple subplots for easy comparison and interpretation.
2 Results
This section showcases the outcomes derived from implementing and visualizing composi-
tions of linear transformations on a two-dimensional input space. Each transformation is
applied in sequence, with the resulting grids displayed. The accuracy of these transforma-
tions is confirmed through visual validation of their geometric effects, including shearing,
reflection, and rotation. Each figure is distinctly labeled to emphasize the transformations
and their impact.
DS412 LAB REPORT 3 Page 5 of 12
Rendering:
The input space is represented by a grid covering [−2, 3] on both x and y axes. Horizontal
lines are shown as solid red lines and vertical lines as dashed blue lines.
Labeling:
Labeling:
• Axes are labeled, and colors are consistent (red for horizontal, blue for vertical).
Explanation:
The matrix T6 shears the grid:
1 1
T6 =
0 1
This results in xnew = x + y and ynew = y. The grid is accurately transformed as expected
from a shear transformation.
Explanation:
T7 reflects the grid horizontally:
−1 0
T7 =
0 1
xnew = −x, flipping the sheared grid. The transformation has been verified to reflect the
geometry as expected.
DS412 LAB REPORT 3 Page 7 of 12
Labeling:
Explanation:
The transformation matrix T8 is:
1 1 −1
T8 = √
2 1 1
√
It rotates the space by 45° and scales by 1/ 2. The grid spacing and angles confirm the
transformation accuracy.
Explanation:
T9 reflects across the x-axis:
1 0
T9 =
0 −1
It flips y values to −y, producing a vertically mirrored grid of the rotated structure.
DS412 LAB REPORT 3 Page 9 of 12
Figure Description
1 Input space grid (Original)
2 After applying T6 (Shear transformation)
3 After applying T7 on T6 (Reflection after Shear)
4 Composition T7 ◦ T6 (Shear + Reflection)
5 After applying T8 (Rotation + Scaling)
6 After applying T9 on T8 (Reflection after Rotation)
7 Composition T9 ◦ T8 (Rotation + Scaling + Reflection)
3 Inferences
This section presents the logical interpretations, insights, and key learnings derived from
the implementation and visualization of compositions of linear transformations in the
two-dimensional space R2 . By analyzing the results from both sets of transformation
matrices (T6 , T7 for Q1 and T8 , T9 for Q2), we gain a deeper understanding of how
sequential linear transformations affect the geometry of vector spaces.
3.2 Insights
• Visualization Enhances Understanding
Visualizing transformations offers a clearer perspective on the abstract algebraic
process of matrix multiplication. It helps in intuitively understanding how opera-
tions like shear, reflection, rotation, and scaling alter the spatial arrangement of a
grid.
• Linear Transformations as Tools for Space Manipulation
This lab strengthens the concept that linear transformations provide a systematic
way to modify spaces. Whether through compression, stretching, rotation, or re-
flection, selecting appropriate transformation matrices enables precise control over
vector space geometry, with applications in computer graphics, machine learning
(feature space transformations), and robotics (coordinate adjustments).
• Composability of Transformations
Intricate transformations can be built by combining simpler ones. Grasping how
multiple transformations interact is crucial for anticipating and managing the final
outcome, with practical applications in fields like 3D modeling, physics simulations,
and data processing pipelines.
• Geometric Interpretations of Matrices
Each matrix represents a geometric action:
– T6 (Shear): Moves points parallel to one axis.
– T7 (Reflection): Flips points across an axis.
– T8 (Rotation + Scaling): Rotates points while changing their magnitude.
– T9 (Reflection): Reflects points across an axis.
These interpretations help in mentally visualizing the effects of matrices without
needing to perform matrix multiplication by hand.
3.4 Conclusion
In conclusion this lab provided deeper insights into the practical workings of linear trans-
formation compositions. By analyzing the graphical impact of individual transformations
and their combinations, we developed a stronger intuition about how linear transforma-
tions alter vector spaces. The concepts explored in this lab serve as a solid groundwork for
more advanced topics in linear algebra and its applications across data science, machine
learning, computer graphics, and physics.
.