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

From: Fred G. Martin (fredm at cs.uml.edu)
Date: Wed Oct 1 12:48:00 EDT 2008

Jens,
I deleted my install of the soegaard library and had DrScheme re-download
the 2 0 version -- things are the same as before.

I tried your segments->painter test and it worked properly (line segment
from lower-left to center; anti-clockwise rotation).

When I run diagonal-shading, I am definitely getting (0,0) in upper left,
(1,1) in lower right, and  clockwise rotation with rotate90.

Thanks for looking into this... At least I know what the correct behavior is
now; I'll pass this along to my students.

Fred


On Wed, Oct 1, 2008 at 4:49 AM, Jens Axel Soegaard <jensaxel at soegaard.net>wrote:

> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20081001/87f6c0e3/attachment.html>

Posted on the users mailing list.