Bao and Lee – and anyone else who has completed their MicroWorlds Digital Book.

 

I would like for you to read chapter 3 this week (Feb.7-Feb. 11, 2005).  It might be a challenge to get through.  You can take it by sections, then take a break.  While you are taking a break…

Check out the website created by one of Mrs. North’s students at: http://teachertech.rice.edu/Participants/knorth/algebra/david/index.html

Next choose either the triangle or trapezoid assignment at the links below.  Read the code at Mrs. North’s website.  Discuss the code between yourselves.  Draw Dr.Scheme art using the code given and your own modifications.

 

(FYI:  The following pages are found on this CS page:  http://teachertech.rice.edu/Participants/knorth/CS/cs.htm )

 

Review code at:  http://teachertech.rice.edu/Participants/knorth/CS/planescaled.htm

 

Look at the code for triangles and trapezoid…then create your own art using either triangles or trapezoids.  Start with the

http://teachertech.rice.edu/Participants/knorth/CS/triangle.htm

 

http://teachertech.rice.edu/Participants/knorth/CS/trapezoid.htm

            The idea with the trapezoid is to draw your own with 4 lines which connect A B C D to form a trapezoid.

            DO NOT simply copy her code and call it quits.  Yours must be a different size and set of coordinates.

Assignment:  draw the following trapezoids 1- 8.  Be sure to add comments to describe what you are drawing.

Begin with the Cartesian Plane Code Below.

  ;;1.  Original trapezoid

               ;;2.  Dilation with scale factor of 1/2
 
;;3.  Dilation with scale factor of 2
;;original trapezoid
 
;;4.  Translation for new coordinate ( X+2 , Y-1 )
 
;;5.  Reflection across Y-axis created with the coordinate (-X,Y) -> Use the opposite of "X"
 
;;6.  Reflection across X-axis created with the coordinate (X,-Y) -> Use the opposite of "Y"
 
;;7.  Horizontal Reflection on Quadrant I of a trapezoid
;;Original Trapezoid
;;Horizontal Reflection
 
;;8.  Vertical Reflection on Quadrant I of a trapezoid
;;Original Trapezoid
;;Vertical Reflection

 

 

 

Begin with the Cartesian Plane Code below (taken from Mrs. North’s website: http://teachertech.rice.edu/Participants/knorth/CS/cartplane.htm

 

 Cartisian Plane Code
Copy and Paste the code below into DrScheme and Execute.
Remember to add the draw.ss from Language/add teachpack/htdp.

;;=======================TEACH PACK COORDINATE PLANE====================|
;;--------------------> Canvas Size <---------------------
(define L 400)     ;; Length of Canvas
(define M (/ L 2)) ;; Middle
(start L L)        ;; Starts a drawing canvas
 
;;------------------- > X-AXIS and Y-AXIS <------------------
(draw-solid-line (make-posn M 0) (make-posn M L))
(draw-solid-line (make-posn 0 M) (make-posn L M))
 
;;---------------------> Drawing Commands <---------------------------
;;line: posn posn color -> true
;;Draws a line given the start and end points and a color on a cartesian plane
(define (line start end color)
  (draw-solid-line (make-posn (+ (posn-x start) M) (- M (posn-y start)))
                   (make-posn (+ (posn-x end) M) (- M (posn-y end))) color))
 
;;circle: posn number color -> true
;;Draws a circle given the center point, radius and a color on a cartesian plane
(define (circle center radius color)
  (draw-circle (make-posn (+ M(posn-x center)) (- M (posn-y center))) radius color))
 
;;disk: posn number color -> true
;;Draws a solid-disk given the center point, radius and a color on a cartesian plane
(define (disk center radius color)
  (draw-solid-disk (make-posn (+ M(posn-x center)) (- M (posn-y center))) radius color))
 
;;rect: posn number number color -> true
;;Draws a solid-rectangle given the top-left corner point, the length, width and color
(define (rect corner L H color)
  (draw-solid-rect (make-posn (+ M (posn-x corner)) (- M (posn-y corner))) L H color))
;;=======================END OF TEACH PACK COORDINATE PLANE=========================|
 
;;--------------------> Grid Line Markers <-----------------
(line (make-posn -5 100) (make-posn +5 100) 'black)
(line (make-posn 100 -5) (make-posn 100 +5) 'blue)
(line (make-posn -5 -100) (make-posn +5 -100)'green)
(line (make-posn -100 -5) (make-posn -100 +5) 'red)
 
;;-------------------> YOUR PRACTICE FOR MASTERY <-------------
;; type your code HERE
 
 

 

OR Begin with the Scaled Cartesian Plane Code below (taken from Mrs. North’s website: http://teachertech.rice.edu/Participants/knorth/CS/planescaled.htm

 

Scaled Cartisian Plane Code
Copy and Paste the code below into DrScheme and Execute.

Remember to add the draw.ss from Language/add teachpack/htdp.

;;====================TEACH PACK SCALED COORDINATE PLANE==============|
;;--------------------> Constant Definitions <---------------------
(define L 400)     ;; Length of Canvas
(define M (/ L 2)) ;; Middle
(define F 10)      ;; Scale Factor
(start L L)        ;; Starts a drawing canvas
 
;;------------------- > X-AXIS and Y-AXIS <------------------------
(draw-solid-line (make-posn M 0) (make-posn M L))
(draw-solid-line (make-posn 0 M) (make-posn L M))
 
;;-----------------------------> Drawing Commands <-------------------------------
;;line: posn posn color -> true
;;Draws a line given the start and end points and a color on a scaled cartesian plane
(define (line start end color)
  (draw-solid-line (make-posn (+ (*(posn-x start)F)M) (- M (*(posn-y start)F)))
                   (make-posn (+ (*(posn-x end)F) M) (- M (*(posn-y end)F))) color))
 
;;circle: posn number color -> true
;;Draws a circle given the center point, radius and a color on a scaled cartesian plane
(define (circle center radius color)
  (draw-circle (make-posn (+ M(*(posn-x center)F)) (- M (* F(posn-y center)))) 
               (* F radius) color))
 
;;disk: posn number color -> true
;;Draws a solid-disk given the center point, radius and a color on a scaled cartesian plane
(define (disk center radius color)
  (draw-solid-disk (make-posn (+ M(* F(posn-x center))) (- M (* F(posn-y center)))) 
                   (* radius F) color))
 
;;rect: posn number number color -> true
;;Draws a solid-rectangle given the top-left corner point, the length, width and color
(define (rect corner L H color)
  (draw-solid-rect (make-posn (+ M (* F(posn-x corner))) (- M (* F(posn-y corner)))) 
                   (* L F)(* F H) color))
 
;;======================== END OF TEACH PACK COORDINATE PLANE ============================|
 
;;--------------------> Grid Line Markers <-----------------
(line (make-posn -.5 1) (make-posn .5 1) 'black)
(line (make-posn -.5 2) (make-posn .5 2) 'black)
(line (make-posn -.5 3) (make-posn .5 3) 'black)
(line (make-posn -.5 4) (make-posn .5 4) 'black)
(line (make-posn -.5 5) (make-posn .5 5) 'black)
 
 
;;-------------------> YOUR PRACTICE FOR MASTERY <-------------
;; type your code HERE
 

 

1