;; 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-intermediate-lambda-reader.ss" "lang")((modname shapes) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f ()))) ;; to represent a cartesian point in a plane ;; A CartPt is (make-cart-pt Number Number) (define-struct cart-pt (x y)) ;; to represent a circle ;; A Circle is (make-circle CartPt Number String) (define-struct circle (loc rad color)) (define p50x50y (make-posn 50 50)) (define p20x40y (make-posn 20 40)) (define p30x40y (make-posn 30 40)) (define circle1 (make-circle (make-posn 50 50) 50 "red")) (define circle2 (make-circle (make-posn 20 40) 10 "green")) (define circle3 (make-circle (make-posn 30 40) 20 "blue")) (check-expect circle1 (make-circle p50x50y 50 "red")) (check-expect circle2 (make-circle p20x40y 10 "green")) (check-expect circle3 (make-circle p30x40y 20 "blue"))