Module 2 : Geometry
203 : Transformations
___________________________________________________________________________________
A. Cast of Characters
___________________________________________________________________________________
In this section we will set up and define a cast of geometric characters that will be used in today's performance. If you start this project, and later return to it, you will need to re-execute all of the commands and definitions in this section.
>
restart; with(geometry);
>
gb := 'color = blue, filled = true';
>
gr := 'color = red, filled = true';
>
gg := 'color = green, filled = true';
>
gd := 'color = gold, filled = true';
> cw := 'clockwise'; ccw := 'counterclockwise';
Now we'll define some points and line segments.
>
point( Orig, 0,0 ); point( A, 1,3); point( B, 8, 3 );
point( C, 5,9); point( E, -3, 8);
>
dsegment( seg1 , Orig, C); dsegment( seg2 , B,E);
> draw( { A, B, C, E, seg1, seg2}, axes = normal );
And here we'll define some triangles and a square and circle, and then draw them.
>
triangle( t0, [Orig, A,B] );
>
triangle( t1, [A,B,C] );
>
triangle( t2, [A,B,E] );
>
square(s1,[ point(v1,3,1), point(v2,7,1), point(v3,7,5), point(v4,3,5)]);
>
circle(c1, [B, 2]);
> draw( { t0(gb), t1(gd), t2(color=black), s1(gd), c1(gr)}, axes = normal );
___________________________________________________________________________________
B. Translation
___________________________________________________________________________________
One of the simplest transformations is the translation. A translation is simply moving the object to a new position by moving over (left or right) some distance, and vertically (up or down) some distance. This is an example of a rigid transformation which preserves the size of the object.
Here we define an object to translate as the triangle t1 we defined above. Maple performs the translation using a line segment to define the amount of movement. Here we are using segment defined above to translation t1 to a new triangle ta, and then again to another called tb.
>
obj := t1;
>
translation( Ta, obj, seg1 );
>
translation( Tb, Ta, seg1);
> draw( { obj(gb), Ta(gd), Tb(gr) } );
The blue triangle is the original t1. The gold triangle is result of translating that triangle using the line segment seg1 defined above. The red triangle is the result of translating it again by the same distance.
Here is a series of commands which show some of the intermediate steps in a translation.
>
obj := s1; n := 6;
>
for j from 1 to n do
dsegment( seg, Orig, point( GG, j, j) ):
translation( P||j, obj, seg ):
od:
> draw( {obj(gb), P||n(gr), seq(op([P||i(color=black)]),i=1..n-1) } );
___________________________________________________________________________________
C. Rotation
___________________________________________________________________________________
Another rigid transformation is a rotation. Here is a block of code which show various rotations of a triangle.
>
obj := s1; n := 8;
>
for i from 1 to n do
rotation( P||i, obj, i*Pi/6, ccw);
od:
> draw( {obj(gb), seq(op([P||i(color=black)]),i=1..n-1), P||n(gr)}, axes = normal);
___________________________________________________________________________________
D. Reflections
___________________________________________________________________________________
We'll now look at reflections across various axes, lines, and points.
REFLECT ACROSS X & Y AXES
First we define two lines which represent the x and y axes.
> with(geometry):
>
line( x_axis, [point(x1, -10,0), point( x2, 10, 0)]);
> line( y_axis, [point(y1, 0,-10), point( y2, 0, 10)]);
Then we reflect an object, in this case a triangle, across the x - axis, the y - axis, and both, then draw the triangle and three reflections.
>
obj := T2;
>
reflection( rx, obj , x_axis);
Error, (in reflection) wrong type of arguments
>
reflection( ry, obj, y_axis);
Error, (in reflection) wrong type of arguments
>
reflection( rxy, rx, y_axis);
Error, (in reflection) wrong type of arguments
> draw( { obj(gb), rx(gg), ry(gr), rxy(gd) , x_axis(gb), y_axis(gg)});
Error, (in draw) unknown geometric object T2
The blue triangle is this original, the green one is the x - axis reflection, the gold triangle is the y reflection, and the green triangle is the double reflection.
REFLECT ACROSS DIAGONAL LINES
We can reflect an object across any line, not just the x and y axes. First we define some new lines.
>
line( p_diag, [point(x1, -10,-10), point( x2, 10, 10)]);
> line( n_diag, [point(y1, 10,-10), point( y2, -10, 10)]);
Then we define an object and reflect it across one line, the other, then both.
>
obj := T2;
>
reflection( rx, obj, p_diag);
Error, (in reflection) wrong type of arguments
>
reflection( ry, obj, n_diag);
Error, (in reflection) wrong type of arguments
>
reflection( rxy, rx, n_diag);
Error, (in reflection) wrong type of arguments
> draw( { obj(gb), rx(gg), ry(gr), rxy(gd), p_diag(gd), n_diag(gg)});
Error, (in draw) unknown geometric object T2
REFLECT THROUGH A POINT
We also reflect an object through a point. Here is an example where we take a triangle and reflect it through a line ( the green image ), and a point ( the red image).
>
obj := t0; point( Q ,7,5);
>
reflection( rp, obj, Q);
>
reflection( rl, obj, n_diag);
> draw( { obj(gb), rl(gg), rp(gr), n_diag(gg), Q(gr) });
Here is a triangle reflected through three different points.
>
obj := t1;
>
point( Q1, 5,0); reflection( R1, obj, Q1);
>
point( Q2 ,10, 8); reflection( R2, obj, Q2);
>
point( Q3 , -1, 7); reflection( R3, obj, Q3);
> draw( { obj(gb), R1(gr), R2(gl), R3(gg), Q1, Q2, Q3 });
Error, (in draw) the option must be of type equation
___________________________________________________________________________________
E. Stretch & Scale
___________________________________________________________________________________
Another transformation is to scale an object. We make it larger or smaller - keeping the same shape but changing all of the dimensions along with the perimeter and area. This kind of transformation is not a rigid transformation.
>
obj := t2;
>
stretch( T6, obj, .7, Orig);
>
stretch( T7, obj, 1.4, Orig );
> draw( {obj(gb), T6(gr), T7(gd) } );
Here is a sequence of transformations which enlarge a shape.
>
obj := t2; n := 5;
>
for j from 1 to n do stretch( P||j, obj, j, A): od:
> draw({obj(gb), seq(op([P||j(color=black)]),j=1..n) }, axes = normal);
Here is a sequence of transformations which shrink a shape.
>
obj := c1; n := 6; point( G, 1, 7); #full spectrum
>
for j from 1 to n do stretch( P||j, obj, 1/j, G): od:
> draw({P||n(gr), obj(gb), seq(op([P||j(color=black)]),j=1..(n-1))}, axes = normal);
___________________________________________________________________________________
F. Glide Reflections
___________________________________________________________________________________
A glide reflection is actually a combination of two transformations - a reflection and a translation. The net effect of a series of glide reflections is to have foot steps. To create a glide reflection, Maple needs an object, a line to reflect across, and a line segment which is on the same line to be used to define the translation.
>
dsegment( seg , B,E);
> line( lin, [ B,E ]);
Once we have the line and segment (which must be colinear), then we can apply the glide reflection to an object - in this case triangle t2. We will apply it three times, and then draw the results.
>
obj := t2;
>
GlideReflection( ra, obj, lin, seg);
>
GlideReflection( rb, ra, lin, seg);
>
GlideReflection( rc, rb, lin, seg);
> draw( { obj(gb), ra(gr), rb(gg), rc(gd), lin(gg)} );
The blue triangle is the original, the green one is the first glide reflection, the red one is the next, then the green one, and the gold one is the last one. The line used for the reflections is green.
>