PasteRack.org
Paste # 299
2014-04-17 12:34:58

Forked from paste # 5873.

Fork as a new paste.

Paste viewed 19 times.


Embed:

plot

  1. #lang racket   ; draw a graph of cos
  2. (require plot) ; 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