This preview shows page 1. Sign up to view the full content.
Unformatted text preview: ;; posn-x and posn-y also come as well with the structure posn. ;; selector: line-slope: returns a slope in number or the symbol 'vertical when slope is vertical (infinite) s ;; part b: ;; points->line: posn posn -> line ;; purpose: to consume 2 points and generate a line out of them ;; Template: ;; (define (points->line point1 point2) ;; ...(x-posn point1). .. ;; ...(y-posn point1). .. ;; ...(x-posn point2). .. ;; ...(y-posn point2). ..) ;; Examples: (points->line (make-posn 1 1) (make-posn 1 1)) => error: 2 points given are the same ;; (points->line (make-posn 1 1) (make-posn 2 2)) => (make-line (make-posn 1 1) p (define (points->line posn1 posn2) (...
View Full Document
- Fall '07