[racket-dev] Plot Contour Intervals Question (Bug?)

From: Neil Toronto (neil.toronto at gmail.com)
Date: Sat Aug 4 13:27:57 EDT 2012

On 08/03/2012 11:59 AM, Doug Williams wrote:
> (require plot)
>
> (plot (contour-intervals
>         (lambda (x y)
>           (define z (- x y))
>           (cond ((< z -1) -1)
>                 ((> z 1) 1)
>                 (else z)))
>         -2 2 -2 2))
>
> ...
>
> Why is the lower white triangle not colored red - they definitely have
> a value of 1? It's like those points are completely ignored.

Turns out it was an error in the marching squares (intervals) 
implementation: a `<' should have been a `<=' to make an upper test 
symmetric with the corresponding lower test.

I've pushed the fix. Thanks again!

Neil ⊥


Posted on the dev mailing list.