~rhcarvalho/+junk/racket

« back to all changes in this revision

Viewing changes to demo/racket-lang.org/14-plot-graph.rkt

  • Committer: Rodolfo Carvalho
  • Date: 2011-11-13 15:00:09 UTC
  • Revision ID: rhcarvalho@gmail.com-20111113150009-pm1ufhd34omf0hgu
Update to use plot/compat (Racket 5.2).

Should be updated to use the new plot library.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#lang racket   ; draw a graph of cos
2
 
(require plot) ; and deriv^3(cos)
 
2
(require plot/compat) ; and deriv^3(cos)
3
3
(define ((deriv f) x)
4
4
  (/ (- (f x) (f (- x 0.001))) 0.001))
5
5
(define (thrice f) (lambda (x) (f (f (f x)))))