zlacker

[return to "The Sierpinski triangle page to end most Sierpinski triangle pages"]
1. talies+3z[view] [source] 2013-10-08 22:33:18
>>pr_fan+(OP)
For those who happen to have Mathematica, try this to get a smooth, high-resolution interactive fractal explorer (make sure you have a C compiler installed):

  JuliaFP = Compile[
    {{const,_Complex}, {init,_Complex}}, 
    Module[{val=init,n=0},
      While[Abs[val] < 5 && n < 25, val = val^2 + const; n++];
      {Mod[Arg[val]/(2*3.14159), 1], 1 - Abs[val]/5, 1 - Abs[val]/100}
    ],
    CompilationTarget -> "C", 
    RuntimeAttributes -> Listable, 
    RuntimeOptions -> "Speed"
  ];
  
  {fine, coarse} = Table[Complex[j,i], 
    {dx, {0.008, 0.002}}, {i,-1.5,1.5,dx}, {j,-1.5,1.5,dx}
  ];

  pt = {0.0,0.0};
  Graphics[{
    Raster[
      JuliaFP[Complex @@ pt/2, If[ControlActive[], fine, coarse]], 
      {{-2.0,-2.0}, {2.0,2.0}}, 
      ColorFunction-> Hue
    ],
    Locator[Dynamic[pt]]},
    ImageSize -> 800
  ] // Dynamic
P.S. Original post is awesome. I love the cow!
◧◩
2. e12e+pn1[view] [source] 2013-10-09 14:28:01
>>talies+3z
Thank you for this. I tried looking around for the "best fit" for a Mathematica work-alike that is Free software, but came up somewhat short. The closest I could find was Gnu mathics, but it doesn't appear to be very complete (ie: many Mathematica examples won't work). Other alternatives are SAGE and of course Julia -- and I guess SAGE would be the best for "playing" or "live coding"?

Anyone have any insights?

I'll also note that Mathematica looks quite awesome indeed.

◧◩◪
3. ihnort+zy1[view] [source] 2013-10-09 16:05:16
>>e12e+pn1
One of the Julia creators did a fractal demo [1] recently, including the Sierpinski triangle. Julia is now quite nice for interactive work via the IJulia notebook (IPython kernel for Julia). As a bonus, it does not require a C compiler to get good performance.

[1] http://nbviewer.ipython.org/url/beowulf.csail.mit.edu/18.337...

◧◩◪◨
4. talies+jI1[view] [source] 2013-10-09 17:53:22
>>ihnort+zy1
IPython is catching up with the Mathematica frontend, slowly but surely. And that Julia demo is nice -- though I don't think a procedural language like MATLAB is the best model for a scientific language in this day and age.

We (Wolfram) are working on a web frontend for the Wolfram Language that will make the language "effectively" open, even if it is still proprietary.

And after the next version, we're going to be concentrating hard on defining a typed subset of the language that can compile via LLVM to all kinds of targets, including the browser.

[go to top]