Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (define (sum-x points)
- (if (null? points) 0
- (+ (caar points) (sum-x (cdr points)))))
- ;;
- (define (sum-y points)
- (if (null? points) 0
- (+ (cadr (car points)) (sum-y (cdr points)))))
- ;;
- (define (average-point points)
- (let ((aver (list (/ (sum-x points) (length points))
- (/ (sum-y points) (length points)))))
- (list (distance-product aver points) aver)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement