Last active
August 30, 2019 21:59
-
-
Save shonkwiler/bba80f8b648c9c98bcd8fee245ca37ca 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
(* Mathematica code for the GIF "Reinvention" by Clayton Shonkwiler, which | |
you can see here: https://shonk.tumblr.com/post/142103728586 *) | |
tiles = Module[{n = 3, cols, f}, | |
cols = RGBColor /@ {"#bcd6c0", "#f56791", "#46454d"}; | |
f[θ_] := Piecewise[ | |
{{0, θ < 0}, {π/6 (1/2 - 1/2 Cos[π θ]), 0 <= θ < 1}, | |
{π/6, 1 <= θ < 2}, {π/6 (3/2 - 1/2 Cos[π θ]), 2 <= θ < 3}, {π/3, θ >= 3}}]; | |
ParallelTable[ | |
Graphics[{Thickness[.005], | |
Table[ | |
{Blend[cols[[{1, 2, 1}]], 3/π f[(j + 3)/6 + θ]], | |
Line[{Sqrt[3] (i + (-1)^j/4), 3/2 j} + # & /@ {#, -#} | |
&[{Cos[2 π k/n + (-1)^(i + j) f[(j + 3)/6 + θ]], | |
Sin[2 π k/n + (-1)^(i + j) f[(j + 3)/6 + θ]]}]]}, | |
{i, -3, 3}, {j, -3, 3}, {k, 0, 2}]}, | |
PlotRange -> 5, ImageSize -> 540, Background -> cols[[3]]], | |
{θ, -1., 3 - #, #}] &[4/100] | |
]; | |
Export[NotebookDirectory[] <> "tiles.gif", tiles, "DisplayDurations" -> {1/24}] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment