How would I go about generating this sort of fractal?

105 Views Asked by At

Don't really know if this question belongs here or on stack overflow, so sorry if this is not the right place. I have picture of this fractal:

https://i.stack.imgur.com/KsVRs.png

I have not seen this fractal among other more popular fractals. I don't know if this is a valid fractal. How would I go about generating this sort of fractal?

2

There are 2 best solutions below

1
On

This is very similar to the the Viscek fractal.

I have a feeling like they are equal, but I can't prove it from the top of my head. The edges on the NW/SW/SE/NE side don't really contribute to the recursion, so they should be equal at the limit.

Information about generating the Viscek fractal and some basic properties can be found on the wikipedia page - https://en.wikipedia.org/wiki/Vicsek_fractal .

2
On

You can use an L-system to generate the fractal. F denotes move forward one unit, + rotate left 90 degrees, - rotate right 90 degrees.

Level 0
starting from top of leftmost edge pointing east

F+F-F+F -F- F+F-F+F -F- F+F-F+F -F- F+F-F+F -F-
=:
L(0) -F-

Level 1
starting from 1/3 of the way down the rightmost edge of the center square (1/3 size) pointing east

F+F-F+F -F- F+F-F+F -F- F+F-F+F -F- F+F-F+F +F-F+
F+F-F+F -F- F+F-F+F -F- F+F-F+F -F- F+F-F+F +F-F+
F+F-F+F -F- F+F-F+F -F- F+F-F+F -F- F+F-F+F +F-F+
F+F-F+F -F- F+F-F+F -F- F+F-F+F -F- F+F-F+F +F-F+
=
L(0) +F-F+ L(0) +F-F+ L(0) +F-F+ L(0) +F-F+
=:
L(1) +F-F+

Level 2
starting from 1/3 of the way down the rightmost edge of the center square (1/7 size) pointing east

L(1) +F-F+ L(1) +F-F+ L(1) +F-F+ L(1) +F-F+
=:
L(2) +F-F+

Level 3 and beyond, similarly

L(n) +F-F+ L(n) +F-F+ L(n) +F-F+ L(n) +F-F+
=:
L(n+1) +F-F+