test-plot.scm 403 B

123456789101112131415161718
  1. #!/usr/bin/env scheme-r7rs
  2. ; This is a script to test the plotting library
  3. (import (scheme base)
  4. (scheme inexact)
  5. (macduffie plot))
  6. ; For testing
  7. (define (f1 x) (* x x))
  8. (define (f2 x) (/ 1 (+ 0.02 x)))
  9. (define (f3 x) (sqrt (+ (* x x) 1)))
  10. (define (f4 x) (sqrt (- 1 (* x x))))
  11. ; (plot f1 -5 40 -8 8 24 80)
  12. ; (plot f2 0 3 0 3 24 80)
  13. ; (plot f3 0 4 -3 3 24 80)
  14. (plot f4 0 1 -1 1 24 80)