Split up tests to keep DrDr from timing out
This commit is contained in:
parent
f182a2719f
commit
c6cc3dfb31
50
collects/plot/tests/isosurface-tests.rkt
Normal file
50
collects/plot/tests/isosurface-tests.rkt
Normal file
|
@ -0,0 +1,50 @@
|
|||
#lang racket
|
||||
|
||||
(require plot plot/utils)
|
||||
|
||||
(time
|
||||
(plot3d (isosurface3d (λ (x y z) (sqrt (+ (sqr x) (sqr y) (sqr z)))) 1
|
||||
#:color 2 #:line-color (->brush-color 2) #:line-width 1
|
||||
#:label "Sphere")
|
||||
#:x-min -0.8 #:x-max 0.8
|
||||
#:y-min -0.8 #:y-max 0.8
|
||||
#:z-min -0.8 #:z-max 0.8
|
||||
#:altitude 30
|
||||
#:legend-anchor 'center))
|
||||
|
||||
(time
|
||||
(define saddle (λ (x y z) (- (sqr x) (* 1/2 (+ (sqr y) (sqr z))))))
|
||||
(plot3d (isosurfaces3d saddle #:d-min -1 #:d-max 1 #:label "d")
|
||||
#:x-min -2 #:x-max 2
|
||||
#:y-min -2 #:y-max 2
|
||||
#:z-min -2 #:z-max 2
|
||||
#:legend-anchor 'top-left))
|
||||
|
||||
(time
|
||||
(define saddle (λ (x y z) (- (sqr x) (* 1/2 (+ (sqr y) (sqr z))))))
|
||||
(plot3d (isosurfaces3d saddle #:d-min -1 #:d-max 1
|
||||
#:colors '(1 2 3)
|
||||
#:line-colors '(1 2 3)
|
||||
#:line-styles '(solid)
|
||||
#:alphas '(3/4)
|
||||
#:label "d")
|
||||
#:x-min -2 #:x-max 2
|
||||
#:y-min -2 #:y-max 2
|
||||
#:z-min -2 #:z-max 2
|
||||
#:legend-anchor 'top-left))
|
||||
|
||||
(time
|
||||
(define saddle (λ (x y z) (- (sqr x) (* 1/2 (+ (sqr y) (sqr z))))))
|
||||
(plot3d (isosurface3d saddle -1/4 #:color 0 #:line-color 0 #:alpha 7/8
|
||||
#:label "d = -1/4")
|
||||
#:x-min -2 #:x-max 2
|
||||
#:y-min -2 #:y-max 2
|
||||
#:z-min -2 #:z-max 2))
|
||||
|
||||
(time
|
||||
(define (f1 θ ρ) (+ 1 (/ θ 2 pi) (* 1/8 (sin (* 8 ρ)))))
|
||||
(define (f2 θ ρ) (+ 0 (/ θ 2 pi) (* 1/8 (sin (* 8 ρ)))))
|
||||
|
||||
(plot3d (list (polar3d f1 #:samples 41 #:color "navajowhite" #:line-style 'transparent #:alpha 2/3)
|
||||
(polar3d f2 #:samples 41 #:color "navajowhite" #:line-style 'transparent #:alpha 2/3))
|
||||
#:title "A Seashell" #:x-label #f #:y-label #f))
|
50
collects/plot/tests/out-file-tests.rkt
Normal file
50
collects/plot/tests/out-file-tests.rkt
Normal file
|
@ -0,0 +1,50 @@
|
|||
#lang racket
|
||||
|
||||
(require plot plot/utils)
|
||||
|
||||
(define (norm mx my x y)
|
||||
(exp (* -1/2 (+ (sqr (- x mx)) (sqr (- y my))))))
|
||||
|
||||
(define (f x y)
|
||||
(+ (* 1.1 (norm -1.5 -1.5 x y))
|
||||
(* 2 (norm 1 1 x y))
|
||||
(* 1.3 (norm 2 -2 x y))))
|
||||
|
||||
(parameterize ([plot-title "Survival Rate of Torsion Widgets"]
|
||||
[plot-x-label "Torsion"]
|
||||
[plot-y-label "Widgetyness"])
|
||||
(time
|
||||
(plot (contour-intervals f #:alphas '(0.5))
|
||||
#:x-min -5 #:x-max 5 #:y-min -5 #:y-max 5
|
||||
#:out-file "contour-test.png"))
|
||||
|
||||
(time
|
||||
(plot (contour-intervals f)
|
||||
#:x-min -5 #:x-max 5 #:y-min -5 #:y-max 5
|
||||
#:out-file "contour-test.ps"))
|
||||
|
||||
(time
|
||||
(plot (contour-intervals f #:alphas '(0.5))
|
||||
#:x-min -5 #:x-max 5 #:y-min -5 #:y-max 5
|
||||
#:out-file "contour-test.pdf"))
|
||||
|
||||
(time
|
||||
(plot (contour-intervals f)
|
||||
#:x-min -5 #:x-max 5 #:y-min -5 #:y-max 5
|
||||
#:out-file "contour-test.svg")))
|
||||
|
||||
(time
|
||||
(plot3d (contour-intervals3d f -5 5 -5 5 #:alphas '(1/4 3/4))
|
||||
#:out-file "contour3d-test.pdf"))
|
||||
|
||||
(time
|
||||
(plot3d (contour-intervals3d f -5 5 -5 5 #:alphas '(1/4 3/4))
|
||||
#:out-file "contour3d-test.ps"))
|
||||
|
||||
(time
|
||||
(plot3d (contour-intervals3d f -5 5 -5 5 #:alphas '(1/4 3/4))
|
||||
#:out-file "contour3d-test.svg"))
|
||||
|
||||
(time
|
||||
(plot3d (contour-intervals3d f -5 5 -5 5 #:alphas '(1/4 3/4))
|
||||
#:out-file "contour3d-test.png"))
|
|
@ -285,29 +285,6 @@
|
|||
(time (plot (contour-intervals f)
|
||||
#:x-min -5 #:x-max 5 #:y-min -5 #:y-max 5)))
|
||||
|
||||
(parameterize ([plot-title "Survival Rate of Torsion Widgets"]
|
||||
[plot-x-label "Torsion"]
|
||||
[plot-y-label "Widgetyness"])
|
||||
(time
|
||||
(plot (contour-intervals f1 #:alphas '(0.5))
|
||||
#:x-min -5 #:x-max 5 #:y-min -5 #:y-max 5
|
||||
#:out-file "contour-test.png"))
|
||||
|
||||
(time
|
||||
(plot (contour-intervals f1)
|
||||
#:x-min -5 #:x-max 5 #:y-min -5 #:y-max 5
|
||||
#:out-file "contour-test.ps"))
|
||||
|
||||
(time
|
||||
(plot (contour-intervals f1 #:alphas '(0.5))
|
||||
#:x-min -5 #:x-max 5 #:y-min -5 #:y-max 5
|
||||
#:out-file "contour-test.pdf"))
|
||||
|
||||
(time
|
||||
(plot (contour-intervals f1)
|
||||
#:x-min -5 #:x-max 5 #:y-min -5 #:y-max 5
|
||||
#:out-file "contour-test.svg")))
|
||||
|
||||
(time
|
||||
(define (f2 x) (sin (* x pi)))
|
||||
(plot (list (x-tick-lines)
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#lang racket
|
||||
|
||||
(require "../main.rkt"
|
||||
"../utils.rkt")
|
||||
(require plot plot/utils)
|
||||
|
||||
;(plot-new-window? #t)
|
||||
|
||||
|
@ -14,6 +13,10 @@
|
|||
[plot-foreground-alpha 1/2])
|
||||
(plot3d (surface3d (λ (x y) (* (sin x) (sin y))) -2 2 -2 2 #:label "z = trig(x,y)")))
|
||||
|
||||
(time
|
||||
(plot3d (points3d '(#(0.1 0.6 0.3)))
|
||||
#:x-min 0 #:x-max 1 #:y-min 0 #:y-max 1 #:z-min 0 #:z-max 1))
|
||||
|
||||
(time
|
||||
(define x-ivls (bounds->intervals (linear-seq 2 8 10)))
|
||||
(define y-ivls (bounds->intervals (linear-seq -5 5 10)))
|
||||
|
@ -133,7 +136,6 @@
|
|||
(points3d (map vector xs ys zs)))
|
||||
#:x-min -1 #:x-max 1 #:y-min -1 #:y-max 1 #:z-min -1 #:z-max 1))
|
||||
|
||||
|
||||
(define (norm mx my x y)
|
||||
(exp (* -1/2 (+ (sqr (- x mx)) (sqr (- y my))))))
|
||||
|
||||
|
@ -206,71 +208,4 @@
|
|||
(contours3d f4 -4 4 -4 4))
|
||||
#:angle -30))
|
||||
|
||||
(time
|
||||
(plot3d (contour-intervals3d f5 -5 5 -5 5 #:alphas '(1/4 3/4))
|
||||
#:out-file "contour3d-test.pdf"))
|
||||
|
||||
(time
|
||||
(plot3d (contour-intervals3d f5 -5 5 -5 5 #:alphas '(1/4 3/4))
|
||||
#:out-file "contour3d-test.ps"))
|
||||
|
||||
(time
|
||||
(plot3d (contour-intervals3d f5 -5 5 -5 5 #:alphas '(1/4 3/4))
|
||||
#:out-file "contour3d-test.svg"))
|
||||
|
||||
(time
|
||||
(plot3d (contour-intervals3d f5 -5 5 -5 5 #:alphas '(1/4 3/4))
|
||||
#:out-file "contour3d-test.png"))
|
||||
|
||||
(time (plot3d (contour-intervals3d f1 -4 4 -4 4)))
|
||||
|
||||
(time
|
||||
(plot3d (isosurface3d (λ (x y z) (sqrt (+ (sqr x) (sqr y) (sqr z)))) 1
|
||||
#:color 2 #:line-color (->brush-color 2) #:line-width 1
|
||||
#:label "Sphere")
|
||||
#:x-min -0.8 #:x-max 0.8
|
||||
#:y-min -0.8 #:y-max 0.8
|
||||
#:z-min -0.8 #:z-max 0.8
|
||||
#:altitude 30
|
||||
#:legend-anchor 'center))
|
||||
|
||||
(time
|
||||
(define saddle (λ (x y z) (- (sqr x) (* 1/2 (+ (sqr y) (sqr z))))))
|
||||
(plot3d (isosurfaces3d saddle #:d-min -1 #:d-max 1 #:label "d")
|
||||
#:x-min -2 #:x-max 2
|
||||
#:y-min -2 #:y-max 2
|
||||
#:z-min -2 #:z-max 2
|
||||
#:legend-anchor 'top-left))
|
||||
|
||||
(time
|
||||
(define saddle (λ (x y z) (- (sqr x) (* 1/2 (+ (sqr y) (sqr z))))))
|
||||
(plot3d (isosurfaces3d saddle #:d-min -1 #:d-max 1
|
||||
#:colors '(1 2 3)
|
||||
#:line-colors '(1 2 3)
|
||||
#:line-styles '(solid)
|
||||
#:alphas '(3/4)
|
||||
#:label "d")
|
||||
#:x-min -2 #:x-max 2
|
||||
#:y-min -2 #:y-max 2
|
||||
#:z-min -2 #:z-max 2
|
||||
#:legend-anchor 'top-left))
|
||||
|
||||
(time
|
||||
(define saddle (λ (x y z) (- (sqr x) (* 1/2 (+ (sqr y) (sqr z))))))
|
||||
(plot3d (isosurface3d saddle -1/4 #:color 0 #:line-color 0 #:alpha 7/8
|
||||
#:label "d = -1/4")
|
||||
#:x-min -2 #:x-max 2
|
||||
#:y-min -2 #:y-max 2
|
||||
#:z-min -2 #:z-max 2))
|
||||
|
||||
(time
|
||||
(define (f1 θ ρ) (+ 1 (/ θ 2 pi) (* 1/8 (sin (* 8 ρ)))))
|
||||
(define (f2 θ ρ) (+ 0 (/ θ 2 pi) (* 1/8 (sin (* 8 ρ)))))
|
||||
|
||||
(plot3d (list (polar3d f1 #:samples 41 #:color "navajowhite" #:line-style 'transparent #:alpha 2/3)
|
||||
(polar3d f2 #:samples 41 #:color "navajowhite" #:line-style 'transparent #:alpha 2/3))
|
||||
#:title "A Seashell" #:x-label #f #:y-label #f))
|
||||
|
||||
(time
|
||||
(plot3d (points3d '(#(0.1 0.6 0.3)))
|
||||
#:x-min 0 #:x-max 1 #:y-min 0 #:y-max 1 #:z-min 0 #:z-max 1))
|
||||
|
|
Loading…
Reference in New Issue
Block a user