Untitled
public text v1 · immutable;; question 3
;; on-line : number number list -> list
;; returns a list of posns whose x and y
;; values satisfy the equation y=ax+b
;; from given numbers a and b and a
;; given list of posns
(define (on-line a b plist)
(cond
[(empty? plist) empty]
[else (cond
[(= (posn-y (first plist)) (+ (* a (posn-x (first plist))) b))
(cons (first plist) (on-line a b (rest plist)))]
[else (on-line a b (rest plist))])]))