a perspective on mathematics, the pattern, and the abstract

Each snowflake is algorithmically generated using some randomness to create infinitely many snowflakes where no two are exactly alike.

Mathematica code:

rr[n_] := (SeedRandom[n]; RandomReal[])

H = Table[{Cos[n*Pi/3], Sin[n*Pi/3]}, {n, 0, 5, 1}];

SnowFlake[Q_, x_, y_, R_, S_, k_, h_, o_, s_, N_, PR_, IS_] :=

Graphics[{

Rotate[

Translate[

Scale[

Table[

Table[

Rotate[

Translate[

Scale[

Table[

{AbsoluteThickness[k*h^(n - 1)], Opacity[o], White,

Line[

{{0, 0}, H[[i]]}]},

{i, 1, 6, 1}],

s^(n - 1)],

{If[n == 1, 0, rr[Q*n]], 0}],

If[n == 1, 0, (j + rr[Q*n])*Pi/3], {0, 0}],

{j, 0, 5, 1}],

{n, 1, N, 1}],

S],

{x, y}],

R, {x, y}]},

PlotRange -> PR, ImageSize -> IS, Background -> Black]

Manipulate[

SnowFlake[Q, 0, 0, rr[2 Q] Pi/3, 1, k, h, o, s, N, 2, 500],

{Q, 1, 1000, 1}, {{k, 1}, 0, 2}, {{h, .9}, 1, 0},

{{o, .75}, 1, 0}, {{s, .75}, 1, 0}, {{N, 10}, 1, 20, 1}]

Manipulate[

GraphicsGrid[

Table[

SnowFlake[Q*W, 0, 0, (-1)^(Round[rr[4 Q*W]]) (t + rr[2 Q*W]) Pi/3,

1, 1, .85, .8, .5 + .2 rr[3 Q*W], 15, 2, 100],

{Q, q, q+6, 1}, {W, w, w+4, 1}],

Background -> Black, ImageSize -> {500, 700}, AspectRatio->7/5],

{q, 1, 100, 1}, {w, 1, 100, 1}, {t, 0, 1 - 1/25, 1/25}]

Inspired by *Successive Rows of Horizontal Straight Lines from Top to Bottom & Vertical Straight Lines from Left to Right* (1972) by Sol LeWitt.

Mathematica code:

BG =

Polygon[

{ImageScaled[{0, 0}], ImageScaled[{1, 0}],

ImageScaled[{1, 1}], ImageScaled[{0, 1}]},

VertexColors ->

{RGBColor[240/255, 237/255, 222/255],

RGBColor[229/255, 226/255, 211/255],

RGBColor[228/255, 227/255, 209/255],

RGBColor[214/255, 215/255, 199/255]}];

Manipulate[

Graphics[

Table[

Rotate[

Table[

Table[

Line[

{{Mod[i + j/14 + (1 + r) t + r/2, 12], 0},

{Mod[i + j/14 + (1 + r) t + r/2, 12], 12}}],

{j, -i/2, i/2, 1}],

{i, 0, 12, 1}],

-r*Pi/2, {6, 6}],

{r, {0, 1}}],

PlotRange -> {{0, 11.5}, {0, 11.5}}, ImageSize -> 500, Prolog -> BG],

{{t, 11.05}, 0, 12}]

Mathematica code:

Rot60 =

Table[

Table[

RotationTransform[a, {1, 1, 0}, {0, 0, 0}][Tuples[{-1, 1}, 3][[v]]],

{v, 1, 8, 1}],

{a, 0, 2 Pi, 2 Pi/60}]

Edge := {1, 2, 4, 3, 7, 8, 6, 5, 1, 3, 4, 8, 7, 5, 6, 2}

CubeProjections[color_, pr_, b_, s_, h_, w_, m_, a_] :=

Graphics[

Table[

Translate[

{AbsoluteThickness[h], If[color == 0, Black, White],

Line[

Table[

Table[

Rot60[[1 + Mod[w (y + m*x) + a, 60]]][[Edge[[k]]]][[c]],

{c, 1, 2, 1}],

{k, 1, 16, 1}]]},

{s*x, s*y}],

{x, -6, 6, 1}, {y, -b, b, 1}],

PlotRange -> {{-pr/3, pr/3}, {-pr+1, pr-1}}, ImageSize -> 500,

Background -> If[color == 0, White, Black]

]

Manipulate[

PM = {color, pr, b, s, h, w, m, a};

CubeProjections[color, pr, b, s, h, w, m, a],

{color, 0, 1, 1}, {{pr, 17}, 1, 52}, {{b, 5}, 1, 20, 1},

{{s, 3}, 0, 5}, {{h, 1}, .01, 10},

{{w, 1}, 0, 20, 1},{{m, 1}, 0, 20, 1},

{a, 1, 60, 1}]

P = {0, 29, 20, 1.3, 2.5, 1, 0, 0}

Manipulate[

CubeProjections30[P[[1]], P[[2]], P[[3]], P[[4]], P[[5]], P[[6]],

P[[7]], a],

{a, 1, 30, 1}]

from patternstream

Anonymous

asks:

How long have you been coding for?

I don’t have any experience coding outside of Mathematica, and only started using it about a year ago. Even within Mathematica, a powerful and diverse programming language that lets you do much more than make neat GIFs, my experience is limited to the most basic graphic primitives. Since then this blog has basically served as a ‘progress’ blog for learning Mathematica, which has a very reasonable learning curve provided the user has some mathematical maturity. it would be nice to try learning other languages too.

Mathematica code:

Rot =

Table[

Table[

RotationTransform[a, {1, 1, 0}, {0, 0, 0}][Tuples[{-1, 1}, 3][[v]]],

{v, 1, 8, 1}],

{a, 0, 2 Pi, 2 Pi/100}]

Edge := {1, 2, 4, 3, 7, 8, 6, 5, 1, 3, 4, 8, 7, 5, 6, 2}

CubeProjections[color_, pr_, b_, s_, h_, w_, m_, a_] :=

Graphics[

Table[

Translate[

{AbsoluteThickness[h], If[color == 0, Black, White],

Line[

Table[

Table[

Rot[[1 + Mod[w (y + m*x) + a, 100]]][[Edge[[k]]]][[c]],

{c, 1, 2, 1}],

{k, 1, 16, 1}]]},

{s*x, s*y}],

{x, -b, b, 1}, {y, -b, b, 1}],

PlotRange -> {{-5*pr/14, 5*pr/14}, {-pr, pr}}, ImageSize -> 500,

Background -> If[color == 0, White, Black]

]

Manipulate[

PM = {color, pr, b, s, h, w, m, a};

CubeProjections[color, pr, b, s, h, w, m, a],

{color, 0, 1, 1}, {{pr, 17}, 1, 52}, {{b, 5}, 1, 20, 1},

{{s, 3}, 0, 5}, {{h, 1}, .01, 10},

{{w, 1}, 0, 20, 1},{{m, 1}, 0, 20, 1},

{a, 1, 100, 1}]

P = {0, 27.7, 20, 1.3, 2.75, 1, 0, 18}

Show@

CubeProjections[P[[1]],P[[2]],P[[3]],P[[4]],P[[5]],P[[6]],P[[7]],P[[8]]]

Mathematica code:

RotAxis =

Table[Table[

Table[

R[o, {.01 + x, .01 + y, 0}, {0, 0, 0}],

{o, 0, 2 Pi, 2 Pi/80}],

{x, -10, 10, 1}], {y, -10, 10, 1}]

Edge := {1, 2, 4, 3, 7, 8, 6, 5, 1, 3, 4, 8, 7, 5, 6, 2}

CubeProjections[color_, pr_, b_, s_, h_, w_, m_, o_] :=

Graphics[

Table[

Translate[

{AbsoluteThickness[h], If[color == 0, Black, White],

Line[

Table[

Table[

RotAxis[[11 + y]][[11 + x]][[o]][[Edge[[k]]]][[c]],

{c, 1, 2, 1}],

{k, 1, 16, 1}]]},

{s*x, s*y}],

{x, -b, b, 1}, {y, -b, b, 1}],

PlotRange -> {{-pr, pr}, {-pr, pr}}, ImageSize -> 500,

Background -> If[color == 0, White, Black]

]

Manipulate[

PM = {color, pr, b, s, h, w, m, a};

CubeProjections[color, pr, b, s, h, w, m, a],

{color, 0, 1, 1}, {{pr, 17}, 1, 52}, {{b, 5}, 1, 10, 1},

{{s, 3}, 0, 5}, {{h, 1}, .01, 10},

{{w, 1}, 0, 20, 1},{{m, 1}, 0, 20, 1},

{a, 1, 80, 1}]

P = {0, 20, 5, 3.6, 1.5, 1, 1, 1}

Manipulate[

CubeProjections[P[[1]],P[[2]],P[[3]],P[[4]],P[[5]],P[[6]],P[[7]],a],

{a, 1, 79, 2}]

Mathematica code:

Rot =

Table[

Table[

RotationTransform[a, {1, 1, 0}, {0, 0, 0}][Tuples[{-1, 1}, 3][[v]]],

{v, 1, 8, 1}],

{a, 0, 2 Pi, 2 Pi/100}]

Edge := {1, 2, 4, 3, 7, 8, 6, 5, 1, 3, 4, 8, 7, 5, 6, 2}

CubeProjections[color_, pr_, b_, s_, h_, w_, m_, o_] :=

Graphics[

Table[

Translate[

{AbsoluteThickness[h], If[color == 0, Black, White],

Line[

Table[

Table[

Rot[[1 + Mod[w (y + m*x) + a, 100]]][[Edge[[k]]]][[c]],

{c, 1, 2, 1}],

{k, 1, 16, 1}]]},

{s*x, s*y}],

{x, -b, b, 1}, {y, -b, b, 1}],

PlotRange -> {{-pr, pr}, {-pr, pr}}, ImageSize -> 500,

Background -> If[color == 0, White, Black]

]

Manipulate[

PM = {color, pr, b, s, h, w, m, a};

CubeProjections[color, pr, b, s, h, w, m, a],

{color, 0, 1, 1}, {{pr, 17}, 1, 52}, {{b, 5}, 1, 10, 1},

{{s, 3}, 0, 5}, {{h, 1}, .01, 10},

{{w, 1}, 0, 20, 1},{{m, 1}, 0, 20, 1},

{a, 1, 100, 1}]

P = {1, 28, 9, 3, 1.4, 1, 1, 30}

Manipulate[

CubeProjections[P[[1]],P[[2]],P[[3]],P[[4]],P[[5]],P[[6]],P[[7]],a],

{a, 48, 0, -2}]

2-D projections of rotating cubes

Mathematica code:

Rot =

Table[

Table[

RotationTransform[a, {1, 1, 0}, {0, 0, 0}][Tuples[{-1, 1}, 3][[v]]],

{v, 1, 8, 1}],

{a, 0, 2 Pi, 2 Pi/100}]

Edge := {1, 2, 4, 3, 7, 8, 6, 5, 1, 3, 4, 8, 7, 5, 6, 2}

CubeProjections[color_, pr_, b_, s_, h_, w_, m_, o_] :=

Graphics[

Table[

Translate[

{AbsoluteThickness[h], If[color == 0, Black, White],

Line[

Table[

Table[

Rot[[1 + Mod[w (y + m*x) + a, 100]]][[Edge[[k]]]][[c]],

{c, 1, 2, 1}],

{k, 1, 16, 1}]]},

{s*x, s*y}],

{x, -b, b, 1}, {y, -b, b, 1}],

PlotRange -> {{-pr, pr}, {-pr, pr}}, ImageSize -> 500,

Background -> If[color == 0, White, Black]

]

Manipulate[

PM = {color, pr, b, s, h, w, m, a};

CubeProjections[color, pr, b, s, h, w, m, a],

{color, 0, 1, 1}, {{pr, 17}, 1, 52}, {{b, 5}, 1, 10, 1},

{{s, 3}, 0, 5}, {{h, 1}, .01, 10},

{{w, 1}, 0, 20, 1},{{m, 1}, 0, 20, 1},

{a, 1, 100, 1}]

P = {0, 26.7, 7, 3.5, 1.3, 5, 1, 0}

Manipulate[

CubeProjections[P[[1]],P[[2]],P[[3]],P[[4]],P[[5]],P[[6]],P[[7]],a],

{a, 48, 0, -2}]

Anonymous

asks:

Do you mind people porting your Mathematica code to other languages?

of course not! Let’s call it ours*. Feel free but please at least share the output if possible

i prefer to adopt a loose definition of art in which the object under consideration may not be intended as art in its initial conception by its creator, but is rather made into art by whoever allows themselves to perceive the object with an artistic perspective. With this definition what constitutes art is a matter of subjective opinion or willingness. This will allow us to talk about “gif-art” more generally as just “gifs”, and i think this is ok because what i like about gif-art is equally true for any kind of gif—its ability to loop.

I think the main purpose of the animated gif is to express things in the medium that exists between a still image and videos of arbitrarily long length. However, its important the duration of the gif be kept short (a couple of seconds at most). It is in this optimum time interval where the content in the gif has the most impact because of how long it takes the gif to repeat, which we’ll refer to as the gif’s loop. If the gif takes too long to loop then it may not reinforce its content with as dramatic of an effect. Gifs don’t have to have infinite loops, and can be made to loop for just some number of times only, or not loop at all, but gifs of this variety seem rare.

To me this endless looping feature is the essence of the gif. The loop has the ability to create an additional effect for the viewer that would not be present otherwise, which is kind of peculiar because there is no new information being introduced. Yet, by seeing something loop over and over the gif is able to capture and exaggerate it to a greater level. This is a nice quality and applies to almost any thing that is looped—whether its something beautiful, funny, awkward, amazing, or trippy, etc.— and its this versatility in expression that shows how effective the gif really is.

I am particularly interested in gifs that loop seamlessly where there is no obvious beginning or end to the gif. Gifs that have this property exemplify another essential feature of the loop which is its ability to make some event seem timeless or eternal. Exploiting this feature of gifs offers interesting and creative directions for art itself, but honestly i just like to stare at them and sometimes find myself staring at a gif for long enough that i won’t admit how long really.

Another good example where looping is used as a creative means different than this sort of perpetual motion just described is actually in your work at MiRon. This is interesting because although the gif is not trying to directly capture motion it uses it to convey a sense of depth both literally and figuratively. Its like an enhanced image.

i also think its worth mentioning the significance of gifs from a current cultural aspect. I think its completely justified that “gif” (as a verb) was recently chosen by Oxford American Dictionaries as word of the year. The gif medium gaining popularity is no accident for many reasons. Despite being in this current digital age which allows gifs to be shared in unprecedented ways, i feel that society is at a point where not only are gifs welcomed but needed. Its almost as if the existence of the gif is to serve us through all of this immense information and media exchange we may be subject to on a daily basis. Again, this necessity is met by the gifs ability to loop. Like, we need to be reminded that its really just these short finite moments in our experience we really care about, and this reminder is reminding us repeatedly right after it reminds us over and over again.**TLDR:**

i like gifs because i like things that loop.