SHARE
TWEET

Untitled

a guest Nov 19th, 2019 85 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #lang racket
  2. (define (car-flot f) ;;TODO: USE OR REMOVE
  3. (car f))
  4. (define (cdr-flot f)
  5. (force (cdr f)))
  6. (define flot-null null)
  7. (define (flot-null? f)
  8. (null? f))
  9. (define-syntax consflot
  10. (syntax-rules ()
  11. ((consflot a b) (cons a (delay b)))))
  12.  
  13.  
  14.  
  15. (define (gen-signal a b dt c)
  16.   (gen-signal_inter a b dt c 0)
  17.   )
  18.  
  19. (define (gen-signal_inter a b dt c step)
  20.  (letrec (
  21.     [signal (lambda(x) (* a (sin (+ c (* b (* x dt))))))]
  22.     [flot (consflot (signal step) (gen-signal_inter a b dt c (+ step 1)))]
  23.     ) flot))
  24.  
  25. (define flot1 (gen-signal 1 1 0.5 0))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top