### COMPUTER SCIENCE LESSONS

GRAPHIC PROGRAMS
LESSONS
Trapezoid Worksheet Algebra I
DILATIONS, TRANSLATIONS, REFLECTIONS ```;; This uses the scaled cartesian plane code ;;--------------------> TRAPEZOID COMMANDS <------------------ ;;1. Original trapezoid (line (make-posn -3 -1) (make-posn -1 -1) 'blue) ;;A to B (line (make-posn -1 -1) (make-posn 1 -4) 'blue) ;;B to D (line (make-posn -4 -4) (make-posn 1 -4) 'blue) ;;C to D (line (make-posn -4 -4) (make-posn -3 -1) 'blue) ;;C to A ;;2. Dilation with scale factor of 1/2 (line (make-posn -3/2 -1/2) (make-posn -1/2 -1/2) 'red) ;;A to B (line (make-posn -1/2 -1/2) (make-posn 1/2 -2) 'red) ;;B to D (line (make-posn -2 -2) (make-posn 1/2 -2) 'red) ;;C to D (line (make-posn -2 -2) (make-posn -3/2 -1/2) 'red) ;;C to A ;;3. Dilation with scale factor of 2 ;;original trapezoid (line (make-posn -6 -2) (make-posn -2 -2) 'green) ;;A to B (line (make-posn -2 -2) (make-posn 2 -8) 'green) ;;B to D (line (make-posn -8 -8) (make-posn 2 -8) 'green) ;;C to D (line (make-posn -8 -8) (make-posn -6 -2) 'green) ;;C to A ;;4. Translation for new coordinate ( X+2 , Y-1 ) (line (make-posn -1 -2) (make-posn 1 -2) 'black) ;;A to B (line (make-posn 1 -2) (make-posn 3 -5) 'black) ;;B to D (line (make-posn -2 -5) (make-posn 3 -5) 'black) ;;C to D (line (make-posn -2 -5) (make-posn -1 -2) 'black) ;;C to A ;;5. Reflection across Y-axis created with the coordinate (-X,Y) -> Use the opposite of "X" (line (make-posn 3 -1) (make-posn 1 -1) 'blue) ;;A to B (line (make-posn 1 -1) (make-posn -1 -4) 'blue) ;;B to D (line (make-posn 4 -4) (make-posn -1 -4) 'blue) ;;C to D (line (make-posn 4 -4) (make-posn 3 -1) 'blue) ;;C to A ;;6. Reflection across X-axis created with the coordinate (X,-Y) -> Use the opposite of "Y" (line (make-posn -3 1) (make-posn -1 1) 'blue) ;;A to B (line (make-posn -1 1) (make-posn 1 4) 'blue) ;;B to D (line (make-posn -4 4) (make-posn 1 4) 'blue) ;;C to D (line (make-posn -4 4) (make-posn -3 1) 'blue) ;;C to A ;;7. Horizontal Reflection on Quadrant I of a trapezoid ;;Original Trapezoid (line (make-posn 6 3) (make-posn 7 6) 'green) ;;A to B (line (make-posn 7 6) (make-posn 12 6) 'green) ;;B to C (line (make-posn 12 6) (make-posn 14 3) 'green) ;;C to D (line (make-posn 14 3) (make-posn 6 3) 'green) ;;D to A ;;Horizontal Reflection (line (make-posn 6 15) (make-posn 7 12) 'green) ;;A to B (line (make-posn 7 12) (make-posn 12 12) 'green) ;;B to C (line (make-posn 12 12) (make-posn 14 15) 'green) ;;C to D (line (make-posn 14 15) (make-posn 6 15) 'green) ;;D to A ;;8. Vertical Reflection on Quadrant I of a trapezoid ;;Original Trapezoid (line (make-posn 6 14) (make-posn 3 12) 'red) ;;A to B (line (make-posn 3 12) (make-posn 3 7) 'red) ;;B to C (line (make-posn 3 7) (make-posn 6 6) 'red) ;;C to D (line (make-posn 6 6) (make-posn 6 14) 'red) ;;D to A ;;Vertical Reflection (line (make-posn 12 14) (make-posn 15 12) 'red) ;;A to B (line (make-posn 15 12) (make-posn 15 7) 'red) ;;B to C (line (make-posn 15 7) (make-posn 12 6) 'red) ;;C to D (line (make-posn 12 6) (make-posn 12 14) 'red) ;;D to A ```
TO REVIEW AND LEARN COPY SAMPLE CODE INTO SCHEME,
RUN, OBSERVE, COMPARE AND CONTRAST THE CODE!