PasteRack.org
Paste # 15324
2014-06-18 15:19:39

Forked from paste # 68991.

Fork as a new paste.

Paste viewed 1716 times.


Embed:

plot

  1. #lang racket   ; draw a graph of cos
  2. (require plot/bitmap) ; and deriv^3(cos)
  3. (define ((deriv f) x)
  4.   (/ (- (f x) (f (- x 0.001))) 0.001))
  5. (define (thrice f) (lambda (x) (f (f (f x)))))
  6. (plot (list (function ((thrice deriv) sin) -5 5)
  7.             (function cos -5 5 #:color 'blue)))

=>

image