Added rotating-triangle test.
This commit is contained in:
parent
4bce35f0a4
commit
9fb54f1ae9
24
collects/picturing-programs/tests/rotating-triangle.rkt
Normal file
24
collects/picturing-programs/tests/rotating-triangle.rkt
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
;; The first three lines of this file were inserted by DrRacket. They record metadata
|
||||||
|
;; about the language level of this file in a form that our tools can easily process.
|
||||||
|
#reader(lib "htdp-beginner-reader.ss" "lang")((modname rotating-triangle) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f ())))
|
||||||
|
(require picturing-programs)
|
||||||
|
|
||||||
|
(define R 60)
|
||||||
|
(define SIDE (* R (sqrt 3)))
|
||||||
|
(define TRI (triangle SIDE "solid" "blue"))
|
||||||
|
(define CIRC (circle R "solid" "white"))
|
||||||
|
(define tricirc (overlay/xy TRI
|
||||||
|
(- (/ SIDE 2) R) 0
|
||||||
|
CIRC))
|
||||||
|
(define badtricirc
|
||||||
|
(overlay/align "middle" "middle"
|
||||||
|
TRI
|
||||||
|
CIRC))
|
||||||
|
|
||||||
|
(define (rotate-1 pic)
|
||||||
|
(rotate 1 pic))
|
||||||
|
|
||||||
|
(big-bang badtricirc
|
||||||
|
(on-tick rotate-1 .05)
|
||||||
|
(check-with image?)
|
||||||
|
(on-draw show-it))
|
Loading…
Reference in New Issue
Block a user