Created
August 28, 2020 06:12
-
-
Save cieloazul310/3614f144fb2cabd44395399bbda9bdfe to your computer and use it in GitHub Desktop.
This file contains 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
;; Example: Replicator | |
(deftime time 1) | |
(defn sin-transition [s] | |
(sin (* (/ time s) PI)) | |
) | |
(defn path/replicator | |
[xform n path] | |
(->> (reduce #(conj % (mat2d/* (last %) xform)) | |
[(mat2d/ident)] | |
(range (dec n))) | |
(map #(path/transform % path)))) | |
(def timedeg (deg | |
(* 8 (sin-transition 1)) | |
)) | |
:start-sketch | |
(background "#08101D") | |
(style (stroke "#CECCFF" 1) | |
(path/replicator | |
(mat2d/* (translate [6 -6]) | |
(rotate timedeg) | |
(scale [0.95 0.95])) | |
60 | |
(circle [0 0] 40)) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment