;;; Scheme Recursive Art Contest Entry ;;; ;;; Please do not include your name or personal info in this file. ;;; ;;; Title: Spinny Fidget Hexogonally ;;; ;;; Description: ;;; Round and round and round ;;; And round and round the spinny ;;; Fidget fidgets (define (degree-to-radian angle) (/ (* angle 3.141592653598793) 180) ) (define light-blue (rgb .5 1 1)) (define dark-blue (rgb .2 .4 .4)) (define orange (rgb 1 .5 0)) (define dark-orange (rgb .8 .4 0)) (define (hexagon x y r fill-color) (define (draw-line n) (if (= 1 n) (forward r) (begin (forward r) (left 60) (draw-line (- n 1))))) (goto x (- y r)) (setheading 60) (pendown) (color fill-color) (begin_fill) (draw-line 6) (end_fill) (penup) ) (define (tri-hexagon r r-circle start-angle fill-color) (define start-angle (degree-to-radian start-angle)) (define x (* r (cos start-angle))) (define y (* r (sin start-angle))) (define rotation-x (cos (degree-to-radian 120))) (define rotation-y (sin (degree-to-radian 120))) (hexagon x y r-circle fill-color) (hexagon (- (* x rotation-x) (* y rotation-y)) (+ (* x rotation-y) (* y rotation-x)) r-circle fill-color) (hexagon (+ (* x rotation-x) (* y rotation-y)) (- (* y rotation-x) (* x rotation-y)) r-circle fill-color) ) (define (spinner start-angle) (tri-hexagon 75 50 start-angle dark-blue) (tri-hexagon 75 25 start-angle light-blue) (tri-hexagon 75 20 start-angle dark-blue) (tri-hexagon 75 12 start-angle light-blue) ) (define (spiral n start-length) (color (rgb (/ 1 n) (/ 1 n) 1)) (if (= 1 n) (forward start-length) (begin (forward start-length) (left 10) (spiral (- n 1) (+ .1 start-length))) ) ) (define (draw) (penup) (bgcolor light-blue) (speed 0) (goto 0 0) (pendown) (color dark-blue) (spiral 1400 0) (penup) (hexagon 0 0 40 dark-blue) (hexagon 0 0 25 orange) (hexagon 0 0 20 dark-orange) (hexagon 0 0 15 orange) (spinner 0) (goto 1000 1000) (exitonclick) ) ; Please leave this last line alone. You may add additional procedures above ; this line. (draw)