blob: 347bca30834bc71e56650423b6b673242746c834 (
plain) (
blame)
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
;;;; License: CC0-1.0
#lang racket
(provide beside below)
(require "46.rkt")
(require "49.rkt")
(require "50.rkt")
(define (beside painter1 painter2)
(let ((split-point (make-vect 0.5 0.0)))
(let ((paint-left
(transform-painter
painter1
(make-vect 0.0 0.0)
split-point
(make-vect 0.0 1.0)))
(paint-right
(transform-painter
painter2
split-point
(make-vect 1.0 0.0)
(make-vect 0.5 1.0))))
(lambda (frame)
(paint-left frame)
(paint-right frame)))))
(define (below painter1 painter2)
(let ((split-point (make-vect 0.0 0.5)))
(let ((paint-above
(transform-painter
painter2
(make-vect 0.0 0.0)
(make-vect 1.0 0.0)
split-point))
(paint-below
(transform-painter
painter1
split-point
(make-vect 1.0 0.5)
(make-vect 0.0 1.0))))
(lambda (frame)
(paint-above frame)
(paint-below frame)))))
;;; below in terms of rotate operations
(define (below-rot painter1 painter2)
(let ((painter1-270 (counterclockwise-270 painter1))
(painter2-270 (counterclockwise-270 painter2)))
(counterclockwise-270
(counterclockwise-180
(beside painter1-270 painter2-270)))))
|