[plt-scheme] rotate90 is clockwise on einstein; CCW on zorro

From: Jens Axel Soegaard (jensaxel at soegaard.net)
Date: Wed Oct 1 04:49:54 EDT 2008

Fred G. Martin wrote:
> Dear Henderson-users,
>
> OK, this one threw us for a loop.  I loaded soegaard's version of the
> Henderson stuff:
>   
> (require (planet "sicp.ss" ("soegaard" "sicp.plt" 2 0)))
>
> Then I tried rotate90 on einstein and mark-of-zorro.
>
> einstein gets rotated clockwise, but mark-of-zorro is rotated
> counter-clockwise (see attached).
>   
It is clearly a bug. Rotate90 is supposed to rotate the image 90 degrees in
the positive direction (i.e. anti-clockwise).
> Here is another (related?) anomoly.  In looking at the code for zorro,
> it appears that (0,0) is in the lower-left and (1,) is in the
> upper-right:
>   
That sounds right.
> (define mark-of-zorro
>  (let ((v1 (make-vect .1 .9))
>        (v2 (make-vect .8 .9))
>        (v3 (make-vect .1 .2))
>        (v4 (make-vect .9 .3)))
>    (segments->painter
>     (list (make-segment v1 v2)
>           (make-segment v2 v3)
>           (make-segment v3 v4)))))
>
>
>   
 > (paint (segments->painter
          (list (make-segment (make-vect 0.0 0.0)
                              (make-vect 0.5 0.5)))))
[image with segment from lower left to the center]

 > (paint (rotate90
          (segments->painter
           (list (make-segment (make-vect 0.0 0.0)
                               (make-vect 0.5 0.5))))))
[image with segment from lower right to the center]

Conclusion: rotate90 works for painters produced by segments->painter.

Since rotate90 doesn't use the representation of the painter,
the code for rotate90 must be correct. Therefore there must be a problem
with the construction of a painter from a bitmap.

> But when we tried the diagonal shader, it seems that (0,0) is in the
> UPPER-left.  my-diag performs the same as the provided
> diagonal-shading:

> (define my-diag
>  (procedure->painter (lambda (x y) (* 127 (+ x y)))))
>
>   
Another bug, the y-axis is reversed.


I'm slightly puzzled. I think I/we already fixed these bugs before. I 
wonder whether I
accidently uploaded an old version. I'll get back to you either later 
today or
tomorrow.

-- 
Jens Axel Søgaard




Posted on the users mailing list.