-
Notifications
You must be signed in to change notification settings - Fork 0
/
2-50.scm
35 lines (31 loc) · 776 Bytes
/
2-50.scm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
(load "2-48.scm")
(load "2-46.scm")
(load "2-47.scm")
(define (transform-painter painter origin corner1 corner2)
(lambda (frame)
(let ((m (frame-coord-map frame)))
(let ((new-origin (m origin)))
(painter
(make-frame new-origin
(sub-vect (m corner1) new-origin)
(sub-vect (m corner2) new-origin))
)
)
)
)
)
(define (flip-horiz painter)
(transform-painter painter (make-vect 1 0)
(make-vect 0 0)
(make-vect 1 1))
)
(define (rotate-180 painter)
(transform-painter painter (make-vect 1 1)
(make-vect 0 1)
(make-vect 1 0))
)
(define (rotate-270 painter)
(transform-painter painter (make-vect 0 1)
(make-vect 0 0)
(make-vect 1 1))
)