;; draw-snowman consumes a posn, a number and a color (symbol)
;;
;; (draw-snowman position size color)
;; will draw a snowman starting at the x,y coordinates specified
;; by the posn structure position, with a size specified by size
;; as the radius of the bottom of the snowman (bottom circle)
;;
;; note that the position is used as the center of the bottom
;; circle of the snowman.
;;
;; sample usage:
;; (draw-snowman (make-posn 100 200) 50 'red)
;; (draw-snowman (make-posn 200 200) 20 'blue)
;;
;; note that this requires the teachpack draw.ss and requires that the
;; start function has already been called to create a window.
;;
(define (draw-snowman pos size color)
(and
;; draw the big circle at the bottom
(draw-solid-disk pos size color)
(draw-circle pos size 'black)
;; draw the middle at .7 time the size of the big
;; and overlapping a bit
(draw-solid-disk
(make-posn (posn-x pos) ( - (posn-y pos) (* size 1.2)))
(* .7 size)
color)
(draw-circle
(make-posn (posn-x pos) ( - (posn-y pos) (* size 1.2)))
(* .7 size) 'black)
;; draw the head
(draw-solid-disk
(make-posn (posn-x pos) ( - (posn-y pos) (* size 2)))
(* .4 size)
color)
(draw-circle
(make-posn (posn-x pos) ( - (posn-y pos) (* size 2)))
(* .4 size) 'black)
;; draw some arms
(draw-solid-line
(make-posn (+ (posn-x pos) (* size .5)) (- (posn-y pos) (* 1.3 size)))
(make-posn (+ (posn-x pos) (* size 1.3)) (- (posn-y pos) (* 1.8 size)))
'black)
(draw-solid-line
(make-posn (- (posn-x pos) (* size .5)) (- (posn-y pos) (* 1.3 size)))
(make-posn (- (posn-x pos) (* size 1.3)) (- (posn-y pos) (* 1.8 size)))
'black)
))
;(start 300 300)
;(draw-snowman (make-posn 100 200) 50 'red)