Testing Figures

left top

(define (points->open-figure points)
  (if (or (null? points) (null? (cdr points)))
      '()
      (cons (make-line (car points) (car (cdr points)))
	    (points->open-figure (cdr points)))))

(define unit-square
  (points->open-figure
   (list ((list 0 0) (list 0 1)
	  (list 1 1) (list 1 0) (list 0 0)))))

(define unit-right-triangle
  (list (list 0 0) (list 0 1) (list 1 0) (list 0 0)))

(figure-length unit-square)
(figure-length unit-right-triangle)

Jim Miller W3C