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

Forked from paste # 5873.

Fork as a new paste.

Paste viewed 1451 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)))

=>

Gtk initialization failed for display ":0"