SICP Exercise 2.50

Question

Define the transformation flip-horiz, which flips painters horizontally, and transformations that rotate painters counterclockwise by 180 degrees and 270 degrees.

Answer

(define (flip-horiz p)
  (transform-painter p
                     (make-vect 0 1)
                     (make-vect 1 1)
                     (make-vect 0 0)))

(define (rotate-180 p)
  (transform-painter p
                     (make-vect 1 1)
                     (make-vect 0 1)
                     (make-vect 1 0)))

(define (rotate-270 p)
  (transform-painter p
                     (make-vect 0 1)
                     (make-vect 0 0)
                     (make-vect 1 1)))

And our results for these three procedures in order: