An archived instance of discourse for discussion in a Fractal Introductory Colloquium.

Generate some self-similar sets

mark

See if you can use our IFS Visuzlizer to generate the following images. Your answer should include the code that generated the image. For example, the code generating the Sierpinski triangle looks like this:

 [scale(1/2),scale(1/2,[1,0]),
  scale(1/2,[1/2,sqrt(3)/2])]

I copied that right out of the IFS Visualizer. Discourse will format input as a block of code, when it's indented four spaces.

One answer per person, please!

A Skewed Sierpinki triangle

The cross fractal

A self-similar spiral

One with reflection:

Two normal objects

How would you make just a plain old square with an IFS:

Or even just a line segment:

Also, I wonder how those two would change if we fiddled with the functions just a little bit. For example, what if you moved one of the fixed points in the IFS or added rotation?

The Cantor set

How would you generate the Cantor set:

Vanderbilt

I was able to generate the skewed Sierpinski triangle with this code:

[ scale(1/2),scale(1/2,[1,0]),
scale(1/2,[0,sqrt(3)/2])]

Here's the image that was generated:


:slight_smile:

sjenkin1

Results from messing around in class during the lecture:

I have created a spiral, from initially staring with the pre-generated example and edited it, but then I thought:

"Why not go completely off the deep end, Sam?"

So I did. And I grabbed the triangle code and mashed it together with the spiral creating the unholy mess you see before you, the capstone of my studies.


Here is how you can make your own in the IFS Visualiser:

r0 = 0.55;
t = 60.*degree;
[
rotate(t).compose(scale(r0)),
scale(10/17),scale(1/10,[1,0]),
scale(1/2,[1/3,sqrt(4)/3])
]





hcary

Got this, depth of 6.
You can see the initial seed I used.



cbozarth

Line segment

I chose the simple one because it's simple.

dprice1

after tinkering with the spiral, I plugged in these numbers.

r0 = 0.94;
r1 = 0.09;
t = 35*degree;
[
rotate(t).compose(scale(r0)),
scale(r1,[1,0])
]

and got this picture


katyagreb

Here is the square:

afreundt

Here is a cool spiral


tmorse

The Cantor Set

dcutchen

Not what i was intending but pretty cool


[
scale(3/4),scale(3/4,[1,0]),
scale(3/4,[3/4,sqrt(3)/2])
]



Vanderbilt

I just started jamming code together from various examples and I somehow got this:


Which to me looks like flowers floating on a small pond, or perhaps fireworks in the evening sky. Here's the code:

r0 = 0.98;
r1 = 0.08;
t = 137.5*degree;
[
rotate(t).compose(scale(r0)),
scale(r1,[1,0]),
shift([1/2,sqrt(3)/6]).
compose(scale(1/3)).
compose(rotate(-pi/3)),
scale(1/3,[1,0]),
scale(1/3,[-1,0]),
scale(1/3,[-1/2,-sqrt(3)/2])
]











katyagreb

I think I broke the spiral... mine is similar to @Vanderbilt 's
It looks like it is keeping a shape somewhat on the edges...
kind of reminds me of the Julia sets




lgibbs

I made what looks like a diagonal line.Within the Sierpinski gasket, if using the same start point for the first(yellow) and second(blue) set. The first set(yellow) will show and the second set with the same start point will "disappear" . Pretty cool.


mark

@lgibbs Looks like you've used one function twice so that it's essentially an IFS with two functions.

icrawfor

I messed with the serpinski gasket until I got this using:
[
scale(1/2),scale(1/2,[1,0]),
scale(1/2,[1/2,sqrt(3)/2]),
scale(1/4,[0,1/2]),
scale(1/4,[1/2,sqrt(3)/2])
]





kadams

i thought this looked neat