PasteRack.org
Paste # 6480
2019-11-21 03:58:33

Forked from paste # 97561.

Fork as a new paste.

Paste viewed 524 times.


Embed:

plot/pict

  1. #lang racket   ; draw a graph of cos
  2. (require plot/pict) ; 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 (f x))))))
  6. (plot (list (function ((thrice deriv) sin) -5 5)
  7.             (function cos -5 5 #:color 'blue)))

=>

image