File: deprecated.rkt

package info (click to toggle)
racket 7.2%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 125,432 kB
  • sloc: ansic: 258,980; pascal: 59,975; sh: 33,650; asm: 13,558; lisp: 7,124; makefile: 3,329; cpp: 2,889; exp: 499; python: 274; xml: 11
file content (70 lines) | stat: -rw-r--r-- 2,239 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#lang racket/base

(require racket/contract
         racket/class
         plot/utils
         "../common/deprecation-warning.rkt"
         "renderers.rkt")

(provide 
 mix
 (contract-out
  [line
   (->* [(real? . -> . (or/c real? (vector/c real? real?)))]
        [#:samples (and/c exact-integer? (>=/c 2))
         #:width (>=/c 0)
         #:color plot-color/c
         #:mode (one-of/c 'standard 'parametric)
         #:mapping (one-of/c 'cartesian 'polar)
         #:t-min real?
         #:t-max real?]
        renderer2d?)]
  [contour
   (->* [(real? real? . -> . real?)]
        [#:samples (and/c exact-integer? (>=/c 2))
         #:width (>=/c 0)
         #:color plot-color/c
         #:levels (or/c (and/c exact-integer? (>=/c 2)) (listof real?))]
        renderer2d?)]
  [shade
   (->* [(real? real? . -> . real?)]
        [#:samples (and/c exact-integer? (>=/c 2))
         #:levels (or/c (and/c exact-integer? (>=/c 2)) (listof real?))]
        renderer2d?)]
  [surface
   (->* [(real? real? . -> . real?)]
        [#:samples (and/c exact-integer? (>=/c 2))
         #:width (>=/c 0)
         #:color plot-color/c]
        renderer3d?)]))

(define (mix . renderers)
  (deprecation-warning "mix" "list")
  (apply list renderers))

(define (line f
              #:samples [samples 150]
              #:width [width 1]
              #:color [color 'red]
              #:mode [mode 'standard]
              #:mapping [mapping 'cartesian]
              #:t-min [t-min -5]
              #:t-max [t-max 5])
  (deprecation-warning "line" "function, parametric or polar")
  (line-renderer f samples width color mode mapping t-min t-max))

(define (contour f
                 #:samples [samples 50]
                 #:width [width 1]
                 #:color [color 'black]
                 #:levels [levels 10])
  (deprecation-warning "contour" "contours")
  (contour-renderer f samples width color levels))

(define (shade f #:samples [samples 50] #:levels [levels 10])
  (deprecation-warning "shade" "contour-intervals")
  (shade-renderer f samples levels))

(define (surface f #:samples [samples 50] #:width [width 1] #:color [color 'black])
  (deprecation-warning "surface" "surface3d")
  (surface-renderer f samples width color))