Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
17
Task/Fractal-tree/Mathematica/fractal-tree.math
Normal file
17
Task/Fractal-tree/Mathematica/fractal-tree.math
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
fractalTree[
|
||||
pt : {_, _}, \[Theta]orient_: \[Pi]/2, \[Theta]sep_: \[Pi]/9,
|
||||
depth_Integer: 9] := Module[{pt2},
|
||||
If[depth == 0, Return[]];
|
||||
pt2 = pt + {Cos[\[Theta]orient], Sin[\[Theta]orient]}*depth;
|
||||
DeleteCases[
|
||||
Flatten@{
|
||||
Line[{pt, pt2}],
|
||||
fractalTree[pt2, \[Theta]orient - \[Theta]sep, \[Theta]sep,
|
||||
depth - 1],
|
||||
fractalTree[pt2, \[Theta]orient + \[Theta]sep, \[Theta]sep,
|
||||
depth - 1]
|
||||
},
|
||||
Null
|
||||
]
|
||||
]
|
||||
Graphics[fractalTree[{0, 0}, \[Pi]/2, \[Pi]/9]]
|
||||
Loading…
Add table
Add a link
Reference in a new issue