Mathematica Asked by Quantum Fields on May 8, 2021

How can I make the geometrical transformation described in the page 190 in the New Kind of Science book by Stephen Wolfram to produce the fractal pattern?

https://www.wolframscience.com/nks/p190–substitution-systems-and-fractals

That page has a few links at the end, one called "Implementation [of geometric substitution systems]"

https://www.wolframscience.com/nks/notes-5-4--implementation-of-geometric-substitution-systems

It suggest a very simple implementation via complex numbers. The WL code there can be used in the following way:

```
f[z_]:=1/2 (1-I) {I z+1/2,z-1/2}
data[n_]:=Nest[Flatten[N@f[#]]&,{0},n];
ComplexListPlot[data[15],PlotTheme->"Detailed"]
```

You can also use so called `AffineTransform`

and iterated function system (IFS) to build patter more closely to the visual rules. Define:

```
TransformIFS[g_,IFS[l_List]]:=
Module[{prim=First[g],h=Head[g]},
t=Table[GeometricTransformation[prim,l[[i]]],{i,Length[l]}];h[t]];
TransformIFS[g_,ifs_IFS,0]:=g;
TransformIFS[g_,ifs_IFS,1]:=TransformIFS[g,ifs];
TransformIFS[g_,ifs_IFS,n_Integer?Positive] :=
TransformIFS[TransformIFS[g,ifs],ifs,n-1];
HeighwayDragon=IFS[{
AffineTransform[{{{1/2, -1/2},{1/2,1/2}},{1,1}/4}],
AffineTransform[{-{{-1/2, -1/2},{1/2,-1/2}},{1,1}/4}]}];
Table[TransformIFS[Graphics[Rectangle[]],HeighwayDragon,n],{n,0,11}]
```

Another beautiful way of making Lévy C curve fractal from a substitution system is considering representation of substitution systems by paths:

https://www.wolframscience.com/nks/notes-3-5--representation-of-substitution-systems-by-paths

```
Graphics[Line[AnglePath[(-1)^# Pi/2]]]&@
Last[SubstitutionSystem[{0->{0,0,1},1->{1}},{0},14]]
```

Correct answer by Vitaliy Kaurov on May 8, 2021

Get help from others!

Recent Questions

- How can I transform graph image into a tikzpicture LaTeX code?
- How Do I Get The Ifruit App Off Of Gta 5 / Grand Theft Auto 5
- Iv’e designed a space elevator using a series of lasers. do you know anybody i could submit the designs too that could manufacture the concept and put it to use
- Need help finding a book. Female OP protagonist, magic
- Why is the WWF pending games (“Your turn”) area replaced w/ a column of “Bonus & Reward”gift boxes?

Recent Answers

- Jon Church on Why fry rice before boiling?
- Peter Machado on Why fry rice before boiling?
- Joshua Engel on Why fry rice before boiling?
- haakon.io on Why fry rice before boiling?
- Lex on Does Google Analytics track 404 page responses as valid page views?

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP