Linear Transformations and Basic Computer Graphics

This Demonstration applies the concept of linear transformation to map graphical objects. It shows the standard matrix describing the given mapping and the image of the transformed object. You can choose a square, a triangle, or the letter L as the object. A list of linear transformations is available to apply to each of these graphical objects: rotation about the origin through an angle , reflection in a line, orthogonal projection onto a line, scaling with a given factor, and a horizontal or vertical shear.
Choose up to three different actions with the "add transformation" buttons. This shows the ordered list of transformations and the corresponding image of the composite linear transformation. From there you can modify the values of the parameters with the sliders, or you can clear all or one of the actions with one of the "remove transformation" buttons.


  • [Snapshot]
  • [Snapshot]
  • [Snapshot]


With the help of this Demonstration, we want to illustrate the basics of computer graphics. Within this context, the graphical objects are described by collections of straight line segments, since linear transformations map line segments onto line segments. We look at the new positions of the principal vertices of the transformed object, and connect them by straight lines in order to obtain the final image of the original object.
The mathematics of computer graphics is closely related to matrix multiplication. If you are not very familiar with the idea, this is the time to try to understand how to describe the basic transformations with matrices. Look carefully at the form of each standard 2×2 matrix that describes the given transformation. For the transformation that rotates each point about the origin through an angle , the entries are cosines and sines of the angle . The standard matrix for the counterclockwise rotation with positive has the form . Reflections through lines are described by invertible (nonsingular) matrices with entries from the set . Orthogonal projections of points onto lines are described by non-invertible matrices with entries from the set . Scaling with a given factor can be achieved by putting in the diagonal entries and zero elsewhere, that is, scaling is described by a scalar multiple of the identity matrix. For the matrix describes an overall contraction of the object, and for an overall expansion. The standard matrix that describes a horizontal shear is of the form and the standard matrix that describes a vertical shear is of the form . Notice that translating an object is not an option. Indeed, this action cannot be described as a multiplication by a 2×2 matrix, that is, translation is not a linear transformation. In order to translate objects using matrices we must use homogeneous coordinates.
The standard matrix that describes a composite linear transformation can be represented as a multiplication of the standard matrices described above.
Very important: note the order of multiplication! This can be seen, for instance, in the case of a composition of three different transformations: the first transformation to be applied to the object is the rightmost factor in the multiplication, the second transformation is the middle factor, and the third and last action is the leftmost factor.
    • Share:

Embed Interactive Demonstration New!

Just copy and paste this snippet of JavaScript code into your website or blog to put the live Demonstration on your site. More details »

Files require Wolfram CDF Player or Mathematica.

Mathematica »
The #1 tool for creating Demonstrations
and anything technical.
Wolfram|Alpha »
Explore anything with the first
computational knowledge engine.
MathWorld »
The web's most extensive
mathematics resource.
Course Assistant Apps »
An app for every course—
right in the palm of your hand.
Wolfram Blog »
Read our views on math,
science, and technology.
Computable Document Format »
The format that makes Demonstrations
(and any information) easy to share and
interact with.
STEM Initiative »
Programs & resources for
educators, schools & students.
Computerbasedmath.org »
Join the initiative for modernizing
math education.
Step-by-step Solutions »
Walk through homework problems one step at a time, with hints to help along the way.
Wolfram Problem Generator »
Unlimited random practice problems and answers with built-in Step-by-step solutions. Practice online or make a printable study sheet.
Wolfram Language »
Knowledge-based programming for everyone.
Powered by Wolfram Mathematica © 2014 Wolfram Demonstrations Project & Contributors  |  Terms of Use  |  Privacy Policy  |  RSS Give us your feedback
Note: To run this Demonstration you need Mathematica 7+ or the free Mathematica Player 7EX
Download or upgrade to Mathematica Player 7EX
I already have Mathematica Player or Mathematica 7+