(define (make-point x y)
(cons x y))
(define (x-point p)
(car p))
(define (y-point p)
(cdr p))
(define (make-segment p1 p2)
(cons p1 p2))
(define (start-segment s)
(car s))
(define (end-segment s)
(cdr s))
(define (midpoint-segment s)
(make-point
(/ (+ (x-point (start-segment s))
(x-point (end-segment s))) 2)
(/ (+ (y-point (start-segment s))
(y-point (end-segment s))) 2)))
Thursday, June 4, 2009
Ex-2.2
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment