1
$\begingroup$

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

$\endgroup$
1
  • $\begingroup$ Welcome to Mathematica.SE! I suggest that: 1) You take the introductory Tour now! 2) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! 3) As you receive help, try to give it too, by answering questions in your area of expertise. $\endgroup$ Oct 18, 2020 at 20:29

1 Answer 1

5
$\begingroup$

enter image description here

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"]

enter image description here

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}]

enter image description here

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]]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.