PasteRack.org
Paste # 27582
2022-07-09 21:02:36

Fork as a new paste.

Paste viewed 1382 times.


Embed:

  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 x)))))
  6. (plot (list (tick-grid)
  7.             (function ((thrice deriv) sin) -5 5)
  8.             (function cos -5 5 #:color 'blue)))

=>

image