1
|
9277 Views
|
2 Replies
|
3 Total Likes
View groups...
Share
GROUPS:

# Is there a function Fixup[]?

Posted 10 years ago
 In the source code for the CDF demonstration on Fractal Curves, Roman Maeder uses a statement tt=Fixup[t]. Mathematica accepts this statement but I cannot find any documentation on the ?Function? The source is as follows: SetAttributes[Curve, Flat] Curve /: r_c _Curve := r # & /@ c simplify[c_Curve] := c //. {Curve[Turn[r1_], Turn[r2_]] :> Curve[Turn[r1 + r2]], Curve[Turn[[Angle]_ /; [Angle] == 0.0]] :> Curve[]} Iterate[c_Curve, template_Curve] := c /. Move[l_] :> l template Iterate[c_Curve, template : {__Curve}] := c /. Move[l_, n_: 1] :> l template[[n]] Move /: l_Move[l1, args___] := Move[l l1, args] Turn /: l_Turn[a_] := Turn[a] Fractal[c_Curve, t_, n_Integer ?NonNegative] := With[{tt = Fixup[t]}, Nest[Iterate[#, tt] &, c, n]] Manipulate[examples; Graphics[Fractal[ex[[1]], ex[[2]], n], ImageSize -> {450, 400}], {{n, 3, "iterations"}, 0, 5, 1, Appearance -> "Labeled"}, {{ex, examples[[1]], "replacement curves", ControlType -> SetterBar}, Thread[examples -> {Graphics[Fractal[#[[1]], #[[2]], 1], ImageSize -> {70, 70}] & /@ examples}], ControlType -> SetterBar}, SaveDefinitions -> True]  and I get an error in the Fractal function call that I am trying to understand. The CDF runs fine.
2 Replies
Sort By:
Posted 10 years ago
 If you download the "Author Code" from the link in the upper right hand side of http://demonstrations.wolfram.com/FractalCurves/or use this link (which is the link from that page)http://demonstrations.wolfram.com/downloadauthornb.cgi?name=FractalCurvesThen Open all cells in the notebook's section called "Initialization Code" and you will see the definition of all the functions used in the demonstration--including the Fixup function that he defines there.
Posted 10 years ago
 If you download the "Author Code" from the link in the upper right hand side of http://demonstrations.wolfram.com/FractalCurves/or use this link (which is the link from that page)http://demonstrations.wolfram.com/downloadauthornb.cgi?name=FractalCurvesThen Open all cells in the notebook's section called "Initialization Code" and you will see the definition of all the functions used in the demonstration--including the Fixup function that he defines there.