NERCOMP • Amherst College • 22 Feb 2000

Rigid motions of the plane

Objects and transformations for examples

A triangle as a graphics object

We shall use a triangle as an example.  First we form the list pairs of pairs of coordinates of its vertices and the Line (that is, broken line) primitive graphics object:

pairs  =  {{-1, 1 },  {0.25,  -1},  {0.75,  
          0.65}, {-1, 1 } }; 
edges  =  Line[pairs]

To see the triangle's three edges, form a Graphics object...

Graphics[edges]

... and then Show that Graphics object:

Show[Graphics[edges]];

The triangle's vertices will constitute a list of Point primitive graphics objects:

vertices  =  Map[Point,  pairs]

Here are the edges and vertices together...

Show[Graphics[{edges,  vertices}]];

... but it's rather hard to see the vertices because they are so small.  So we enlarge the points by using the PointSize graphics directive.  (The parameter to PointSize is expressed as a fraction of the graphics image width.)

triangle  =  {edges, PointSize[0.025],  vertices}

Now we can see vertices as well as edges:

Show[Graphics[triangle]];

Two plane transformations

Below we'll use two transformations of the plane—reflection across the vertical axis and translation by the vector (1,  2):

reflect[
        p_]  :=    {-p[[1]],  
        p[[2]]}
translate[p_]  :=  p  +  {1, 2}

For example:

reflect[{ 0.75,  0.65}]

translate[ {0.75,  0.65}]

Graphics utility view

Definitions

\(\(view::usage\  = \ 
		"view[objs] displays the 2D graphics objects in the list objs

		with both axes running from -1 to 1.

		view[objs, lo, hi] displays the objects with both axes running from lo to hi. ";\)\)

view[objects_,  low_:  - 1,  high_:  1]  :=  
      Show[makeFigure[objects,  low,  high]]

\(makeFigure[objects_, \ low_:\  - 1, \ high_:  1]\  := \ 	
	
      Graphics[objects, \ 
        PlotRange\  -> \ {{low, \ high}, \ {low, \ 
              high}}, 
		\ AspectRatio\  -> \ Automatic, \ 
        Axes\  -> \ True]\)

Examples

view[triangle];

view[triangle,  -2,  2];

view[{RGBColor[1, 0, 0],  triangle},  -2,  2];

Transformation  utility "image"

Definitions

\(\(image::usage\  = \ 
		"image[T, objs] evaluates the plane transformation T

		at all the points of the object or list of objects objs.";\)\)

image[T_,  object_]  :=  
      object  /.  pt_?Point2DQ  :>  T[pt]

Point2DQ[p_] := VectorQ[p, NumericQ] && Length[p] == 2

Examples

triangle

image[reflect,  triangle]

view[image[reflect,  triangle]];

Exploit infix notation:

Log[2,  32]

2 ~Log~ 32

reflect~image~triangle

view[reflect~image~triangle];

Viewing object and its image

view[{triangle,  image[reflect,  triangle]}];

Distinguish the original from the image by using color:

view[{triangle,  RGBColor[1, 0, 0], 
        image[reflect,  triangle]}];

Images under composition of transformations

To get the image of an object under the composition of two (or more) transformations, just apply the transformations in order.  For example:

stretch[v_]  :=  0.6 v

stretch[{1,  2}]
reflect[%]                              
reflect[stretch[{1, 2}]]

The expression for applying first one transformation, then the other, gets a bit complicated when it is used with the function image:

view[image[reflect,  image[stretch, triangle]],  -2,  
        2];

view[reflect ~image~ stretch ~ image~ triangle,  -2,  
        2];

A way to simplify expressions such as in the preceding input cell is explained in the next section.

Composition notation

Prefix notation @ for composition

reflect[stretch[{1,  2}]]

reflect@stretch[{1,  2}]

view[image[reflect @ stretch,  triangle],  -2,  2]

Function Composition

Composition[reflect,  stretch][{1,  2}]

view[image[Composition[reflect,  stretch],  triangle],  -2,  
        2];

Notation package

Needs["Utilities`Notation`"]

InfixNotation[∘,Composition]

(reflect∘ stretch)[{1, 2}]

image[reflect ∘ stretch,  triangle]

view[image[reflect ∘ stretch, triangle],  -2,  
        2];

Exercises

1. Do stretch and reflect commute?

view[{image[reflect ∘ stretch, triangle],  
          image[stretch ∘ reflect, triangle]},  -2,  
        2];

2. Does reflect commute with translation by {1, -1}?

Clear[translate]

translate[p_]  :=  p  +   {1. ,  -1. }

translate[{1,  2}]

view[{triangle,  RGBColor[1, 0, 0],  
          translate ~image~ triangle},  -2,  2];

view[{(translate ∘ reflect) ~ image~ 
            triangle,  (reflect ∘ translate) ~image~ 
            triangle},  -2,  2];

3. Does reflect commute with rotation through π/6?

rot[p_,  θ_] := (({{Cos[θ], -Sin[θ]}, {Sin[θ],  Cos[θ]}})) . p

rotate[p_]  :=  rot[p,  (π/6)]

view[{triangle,  RGBColor[1, 0, 0],  
          rotate ~image~ triangle},  -2,  2];

view[{(rotate ∘ reflect) ~ image~ 
            triangle,  (reflect ∘ rotate) ~image~ 
            triangle},  -2,  2];

4. Study dilation by factor of 0.75 and  composites of that dilation with

dilate[p_]  :=  0.75 p

5. Study images of the composite of a horizontal shear and a vertical shear;
    is this transformation a rigid motion?

T[p_] := (({{1, 1}, {1, 2}})) . p

view[{triangle,  RGBColor[1, 0, 0],  
          T~image~ triangle},  -3,  3];

6. Why does "connecting the dots" of the images of the original dots correctly produce the image of the entire object?

Main notebook

Copyright © 2000 by Murray Eisenberg.  All rights reserved.