Last active
August 29, 2015 13:56
-
-
Save quephird/9240240 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (ns crossing-circles | |
| (:use quil.core)) | |
| (def θ (atom 0)) | |
| (defn circles [sw] | |
| (stroke-weight sw) | |
| (doseq [i (range 1 15)] | |
| (let [dr (* sw 2.5) | |
| r (* i dr)] | |
| (ellipse 0 0 r r)))) | |
| (defn setup [] | |
| (smooth) | |
| (stroke 0) | |
| (ellipse-mode :center) | |
| (no-fill)) | |
| (defn draw [] | |
| (background 255) | |
| (let [amplitude 200 | |
| phase 250] | |
| (doseq [x [(+ phase (* amplitude (sin (radians @θ)))) | |
| (+ phase (* (- amplitude) (sin (radians @θ))))]] | |
| (push-matrix) | |
| (translate x 250) | |
| (circles 15) | |
| (pop-matrix))) | |
| (swap! θ + 10)) | |
| (sketch | |
| :title "looking up" | |
| :setup setup | |
| :draw draw | |
| :size [500 500] | |
| :renderer :java2d) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment