Advertisement
woonie

Untitled

Aug 28th, 2011
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scheme 0.75 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.  
  13. (define J
  14.   (lambda (t)
  15.     (cond ( (< t (/ 1 3)) ((horizontal-line (make-point 0.2 0.8) 0.6) (* 3 t)))
  16.           ( (< t (/ 2 3)) ((vertical-line (make-point 0.5 0.3) 0.5) (-  (* 3 t) 1)))
  17.           (else ((unit-circle-half (make-point 0.35 0.3)) (- (* 3 t) 2))))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement