diff --git a/pkgs/plot-pkgs/plot-lib/plot/private/common/marching-squares.rkt b/pkgs/plot-pkgs/plot-lib/plot/private/common/marching-squares.rkt index 09598c2826..94cba6148a 100644 --- a/pkgs/plot-pkgs/plot-lib/plot/private/common/marching-squares.rkt +++ b/pkgs/plot-pkgs/plot-lib/plot/private/common/marching-squares.rkt @@ -149,9 +149,7 @@ above. (defproc (heights->lines [xa real?] [xb real?] [ya real?] [yb real?] [z real?] [z1 real?] [z2 real?] [z3 real?] [z4 real?] ) (listof (list/c (vector/c real? real? real?) (vector/c real? real? real?))) - (cond [(and (z . < . z1) (z . < . z2) (z . < . z3) (z . < . z4)) empty] - [(and (z . > . z1) (z . > . z2) (z . > . z3) (z . > . z4)) empty] - [(= z z1 z2 z3 z4) empty] + (cond [(= z z1 z2 z3 z4) empty] [else (define lines (do-heights->lines z z1 z2 z3 z4)) (for/list ([line (in-list lines)]) @@ -591,8 +589,6 @@ above. [z1 real?] [z2 real?] [z3 real?] [z4 real?] ) (listof (listof (vector/c real? real? real?))) (cond - [(and (zb . < . z1) (zb . < . z2) (zb . < . z3) (zb . < . z4)) empty] - [(and (za . > . z1) (za . > . z2) (za . > . z3) (za . > . z4)) empty] [(= za zb z1 z2 z3 z4) (list (list (vector xa ya z1) (vector xb ya z2) (vector xb yb z3) (vector xa yb z4)))] [else diff --git a/pkgs/plot-pkgs/plot-lib/plot/private/plot2d/plot-area.rkt b/pkgs/plot-pkgs/plot-lib/plot/private/plot2d/plot-area.rkt index 77ff41e35e..76b302ea8f 100644 --- a/pkgs/plot-pkgs/plot-lib/plot/private/plot2d/plot-area.rkt +++ b/pkgs/plot-pkgs/plot-lib/plot/private/plot2d/plot-area.rkt @@ -89,14 +89,15 @@ (if identity-transforms? (match-lambda [(vector (? rational? x) (? rational? y)) - (vector (fl (/ (- (inexact->exact x) x-min) x-size)) - (fl (/ (- (inexact->exact y) y-min) y-size)))] + (vector (fl (/ (- x x-min) x-size)) + (fl (/ (- y y-min) y-size)))] [(vector x y) (vector +nan.0 +nan.0)]) (match-lambda [(vector (? rational? x) (? rational? y)) - (vector (fl (/ (- (inexact->exact (fx x)) x-min) x-size)) - (fl (/ (- (inexact->exact (fy y)) y-min) y-size)))] + (let ([x (fx x)] [y (fy y)]) + (vector (if (rational? x) (fl (/ (- (inexact->exact x) x-min) x-size)) +nan.0) + (if (rational? y) (fl (/ (- (inexact->exact y) y-min) y-size)) +nan.0)))] [(vector x y) (vector +nan.0 +nan.0)]))) diff --git a/pkgs/plot-pkgs/plot-lib/plot/private/plot3d/plot-area.rkt b/pkgs/plot-pkgs/plot-lib/plot/private/plot3d/plot-area.rkt index 2799c7c159..ed5339ddc8 100644 --- a/pkgs/plot-pkgs/plot-lib/plot/private/plot3d/plot-area.rkt +++ b/pkgs/plot-pkgs/plot-lib/plot/private/plot3d/plot-area.rkt @@ -152,9 +152,10 @@ (flvector +nan.0 +nan.0 +nan.0)]) (match-lambda [(vector (? rational? x) (? rational? y) (? rational? z)) - (flvector (fl (/ (- (inexact->exact (fx x)) x-mid) x-size)) - (fl (/ (- (inexact->exact (fy y)) y-mid) y-size)) - (fl (/ (- (inexact->exact (fz z)) z-mid) z-size)))] + (let ([x (fx x)] [y (fy y)] [z (fz z)]) + (flvector (if (rational? x) (fl (/ (- (inexact->exact x) x-mid) x-size)) +nan.0) + (if (rational? y) (fl (/ (- (inexact->exact y) y-mid) y-size)) +nan.0) + (if (rational? z) (fl (/ (- (inexact->exact z) z-mid) z-size)) +nan.0)))] [(vector x y z) (flvector +nan.0 +nan.0 +nan.0)])))