From 9fb54f1ae9dbbf4117e22c35be537cea688e6e4f Mon Sep 17 00:00:00 2001 From: Stephen Bloch Date: Thu, 30 Dec 2010 06:58:21 -0500 Subject: [PATCH] Added rotating-triangle test. --- .../tests/rotating-triangle.rkt | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 collects/picturing-programs/tests/rotating-triangle.rkt diff --git a/collects/picturing-programs/tests/rotating-triangle.rkt b/collects/picturing-programs/tests/rotating-triangle.rkt new file mode 100644 index 0000000000..344c6f1fd3 --- /dev/null +++ b/collects/picturing-programs/tests/rotating-triangle.rkt @@ -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))