woonie

sidequest 4.1

Aug 28th, 2011
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scheme 0.82 KB | None | 0 0
  1. (define (vertical-line pt length)
  2.   (lambda (t) (make-point (x-of pt)
  3.                           (+ (* t length)
  4.                              (y-of pt)))))
  5. (define (horizontal-line pt length)
  6.   (lambda (t) (make-point (+ (* t length) (x-of pt))
  7.                           (y-of pt))))
  8. (define (unit-circle-half pt)
  9.   (lambda (t) (make-point (+ (x-of pt) (* 0.15 (sin (* 2pi (+ 0.25 (* 0.5 t))))))
  10.                           (+ (y-of pt) (* 0.15 (cos (* 2pi (+ 0.25 (* 0.5 t)))))))))
  11.  
  12. (define J
  13.   (connect-rigidly (connect-rigidly (vertical-line (make-point 0.5 0.3) 0.5)
  14.                                     (connect-rigidly (horizontal-line (make-point 0.2 0.8) 0.6)
  15.                                                      (horizontal-line (make-point 0.2 0.8) 0.3)))
  16.                    (unit-circle-half (make-point 0.35 0.3))))
Advertisement
Add Comment
Please, Sign In to add comment