Skip to content Skip to navigation

Connexions

You are here: Home » Content » Vector Graphics: Composition of Transformations

Navigation

Lenses

What is a lens?

Definition of a lens

Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

This content is ...

Endorsed by Endorsed (What does "Endorsed by" mean?)

This content has been endorsed by the organizations listed. Click each link for a list of all content endorsed by the organization.
  • IEEE-SPS

    This module is included inLens: IEEE Signal Processing Society Lens
    By: IEEE Signal Processing SocietyAs a part of collection: "A First Course in Electrical and Computer Engineering"

    Click the "IEEE-SPS" link to see all content they endorse.

  • College Open Textbooks display tagshide tags

    This module is included inLens: Community College Open Textbook Collaborative
    By: CC Open Textbook CollaborativeAs a part of collection: "A First Course in Electrical and Computer Engineering"

    Comments:

    "Reviewer's Comments: 'I recommend this book as a "required primary textbook." This text attempts to lower the barriers for students that take courses such as Principles of Electrical Engineering, […]"

    Click the "College Open Textbooks" link to see all content they endorse.

    Click the tag icon tag icon to display tags associated with this content.

Affiliated with (What does "Affiliated with" mean?)

This content is either by members of the organizations listed or about topics related to the organizations listed. Click each link to see a list of all content affiliated with the organization.
  • Bookshare

    This module is included inLens: Bookshare's Lens
    By: Bookshare - A Benetech InitiativeAs a part of collection: "A First Course in Electrical and Computer Engineering"

    Comments:

    "Accessible versions of this collection are available at Bookshare. DAISY and BRF provided."

    Click the "Bookshare" link to see all content affiliated with them.

  • NSF Partnership display tagshide tags

    This module is included inLens: NSF Partnership in Signal Processing
    By: Sidney BurrusAs a part of collection: "A First Course in Electrical and Computer Engineering"

    Click the "NSF Partnership" link to see all content affiliated with them.

    Click the tag icon tag icon to display tags associated with this content.

  • Featured Content display tagshide tags

    This module is included inLens: Connexions Featured Content
    By: ConnexionsAs a part of collection: "A First Course in Electrical and Computer Engineering"

    Comments:

    "A First Course in Electrical and Computer Engineering provides readers with a comprehensive, introductory look at the world of electrical engineering. It was originally written by Louis Scharf […]"

    Click the "Featured Content" link to see all content affiliated with them.

    Click the tag icon tag icon to display tags associated with this content.

Also in these lenses

  • UniqU content

    This module is included inLens: UniqU's lens
    By: UniqU, LLCAs a part of collection: "A First Course in Electrical and Computer Engineering"

    Click the "UniqU content" link to see all content selected in this lens.

  • Lens for Engineering

    This module is included inLens: Lens for Engineering
    By: Sidney Burrus

    Click the "Lens for Engineering" link to see all content selected in this lens.

Recently Viewed

This feature requires Javascript to be enabled.

Tags

(What is a tag?)

These tags come from the endorsement, affiliation, and other lenses that include this content.
 

Vector Graphics: Composition of Transformations

Module by: Louis Scharf. E-mail the author

Note:

This module is part of the collection, A First Course in Electrical and Computer Engineering. The LaTeX source files for this collection were created using an optical character recognition technology, and because of this process there may be more errors than usual. Please contact us if you discover any errors.

Often we will want to perform several operations on an object before we display the result. For example, suppose we want to rotate by π3π3 and reduce to 1212 size in each dimension:

G 1 = R ( π 3 ) G G n e w = S ( 1 2 , 1 2 ) G 1 . G 1 = R ( π 3 ) G G n e w = S ( 1 2 , 1 2 ) G 1 .
(1)

If there are n n points in the matrix G G, it will require 4n4n multiplications to perform each of these operations, for a total of 8n8n multiplications. However, we can save some multiplications by noting that

G n e w = S ( 1 2 , 1 2 ) [ R ( π 3 ) G ] = A G G n e w = S ( 1 2 , 1 2 ) [ R ( π 3 ) G ] = A G
(2)

where

A = S ( 1 2 , 1 2 ) R ( π 3 ) = 1 2 c o s ( π 3 ) - 1 2 s i n ( π 3 ) 1 2 s i n ( π 3 ) l 2 c o s ( π 3 ) . A = S ( 1 2 , 1 2 ) R ( π 3 ) = 1 2 c o s ( π 3 ) - 1 2 s i n ( π 3 ) 1 2 s i n ( π 3 ) l 2 c o s ( π 3 ) .
(3)

In other words, we take advantage of the fact that matrix multiplication is associative to combine S S and R R into a single operation A A, which requires only 8 multiplications. Then we operate on G G with A A, which requires 4n4n multiplications. By “composing” the two operations, we have reduced the total from 8n8n to 4n+84n+8 multiplications. Furthermore, we can now build operators with complex actions by combining simple actions.

Example 1

We can build an operator that stretches objects along a diagonal line by composing scaling and rotation. We must

  1. rotate the diagonal line to the x-axis with R(-θ)R(-θ);
  2. scale with S(s,1)S(s,1); and
  3. rotate back to the original orientation with R(θ)R(θ).

Figure 1 shows a square being stretched along a 45o line. The composite operator that performs this directional stretching is

A ( θ , s ) = R ( θ ) S ( s , 1 ) R ( - θ ) = c o s θ - s i n θ s i n θ c o s θ s 0 0 1 c o s θ s i n θ - s i n θ c o s θ = s c o s 2 θ + s i n 2 θ ( s - 1 ) s i n θ c o s θ ( s - 1 ) s i n θ c o s θ c o s 2 θ + s s i n 2 θ . A ( θ , s ) = R ( θ ) S ( s , 1 ) R ( - θ ) = c o s θ - s i n θ s i n θ c o s θ s 0 0 1 c o s θ s i n θ - s i n θ c o s θ = s c o s 2 θ + s i n 2 θ ( s - 1 ) s i n θ c o s θ ( s - 1 ) s i n θ c o s θ c o s 2 θ + s s i n 2 θ .
(4)

Note that the rightmost operator in a product of operators is applied first.

Figure 1: Rotating and Scaling for Directional Stretching
Figure one is a series of three two-dimensional graphs displaying the rotations of a square. In the first graph, the square is sitting on the x and y-axis with one vertex at the origin, and a dashed diagonal line labeled 45° indicates a rotation about the line y=x. An arc labeled rotate -π/4 describes the rotation. The second graph shows a square laid diagonally along the x-axis, with one vertex at the origin, and the opposite vertex at a positive spot on the x-axis. The third and fourth vertices lay at a 45 degree angle positively and negatively from the origin. An arrow to the right of the square is labeled, scale. The third is a distorted quadrilateral sitting in the same place as the second square, but slightly stretched horizontally to the right. An arc is labeled, rotate, π/4. The fourth is a shape of the same distortion of that of the third graph, now rotated back to closely resemble the position of the square in the first graph, except that since it is a distorted shape, its vertices are located slightly above and to the right of the original vertices in the shape in the first graph.

Content actions

Download module as:

PDF | EPUB (?)

What is an EPUB file?

EPUB is an electronic book format that can be read on a variety of mobile devices.

Downloading to a reading device

For detailed instructions on how to download this content's EPUB to your specific device, click the "(?)" link.

| More downloads ...

Add module to:

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need an account to use 'My Favorites'.

| A lens I own (?)

Definition of a lens

Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks