Skip to content

Instantly share code, notes, and snippets.

@quephird
Last active August 29, 2015 13:56
Show Gist options
  • Select an option

  • Save quephird/9240240 to your computer and use it in GitHub Desktop.

Select an option

Save quephird/9240240 to your computer and use it in GitHub Desktop.
(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