Live data from Hacker News

The Sierpinski triangle page to end most Sierpinski triangle pages

oftenpaper.net

51–60 of 61 posts

Re: The Sierpinski triangle page to end most Sierpinski triangle pages

#52

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

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.

Re: The Sierpinski triangle page to end most Sierpinski triangle pages

#54

A few years ago, I accidentally found this way of creating a Sierpinski Gasket-like structure: https://vimeo.com/7690310 Lines "flow" from left to right (horizontally) or bottom to top (vertically), and all lines start out white. When two lines cross, they might switch color depending on which color they come across, as follows: * white (h) + white (v) = black (h) + black (v) * black (h) + black (v) = black (h) + bla…

What you've got there is a truth table for the XOR bitwise operation. HV | O ---+--- 11 | 0 00 | 0 10 | 1 01 | 1 You can do it very similarly with the coordinates of the pixels on the screen[1]. It's really interesting how often that shape comes out of places. Which is why I think that this page got started. [1] http://www.stilldreamer.com/mathematics/sierpinskis_triangle...

Note that where binary operations on screen coordinates tend to produce Sierpiński's triangle, ternary operations will produce Sierpiński's carpet (I don't know what happens as you increase bases beyond that, the number of possible operations does explode).

Re: The Sierpinski triangle page to end most Sierpinski triangle pages

#56
post #52

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

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 a…

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

Re: The Sierpinski triangle page to end most Sierpinski triangle pages

#58
post #15

Is is just me or is the code source really hard to understand? It's cool that you can represent such complex shapes with just a few lines of code in Mathmatica, but without comments and with all the single letter variables, it's hard for me to follow what's going on.

I agree, but do realize this is written for a mathematical audience, not a CS audience. It's reductive, but it's not that reductive to your average math major/grad student. Code by/for mathematicians is particularly ugly to a professional programmer. There is significant historical (pencil & paper) precedent for what single-letter variables represent in a given context. For a mathematician, ConstantArray[0, {m,n}] re…

This is one of the annoying things about Haskell code -- since many Haskell programmers come from math backgrounds, they tend to use very short variables, often one letter or a letter and a number, where a programmer would use a descriptive variable. Perhaps more annoyingly, as a result of this lineage, it's become part of the convention, so even those who come from a non-math background tend to use short, mathy variable names.

Re: The Sierpinski triangle page to end most Sierpinski triangle pages

#59
post #52

Earlier quoted context omitted.

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 a…

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

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.

Re: The Sierpinski triangle page to end most Sierpinski triangle pages

#60

Earlier quoted context omitted.

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

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 c…

It's tough to catch up with Mathematica when you guys keep putting out such awesome stuff with each new version. It's been great to see Wolfram innovate so much – versions 6, 7, 8 and 9 were all amazing releases (especially after the four-year gap following 5). I found the new symbolic discrete calculus work in 7 and the symbolic statistics capabilities that built on that in 8 to be particularly mind blowing [1][2]. This seems like it was the fruit of a focused, long-term R&D agenda.

Regarding Julia, although the syntax is superficially similar to Matlab and we've intentionally made many things compatible, Julia isn't really modeled on Matlab. Julia is much more influenced by Lisp – much like Mathematica via Macsyma and Maclisp. Julia's dynamic multiple dispatch is somewhat reminiscent of Mathematica's pattern matching dispatch system too, although, of course, the evaluation semantics are radically different.

I hate to quibble, but having a web frontend for Mathematica that you don't charge people to use does not make it "effectively" open. Mathematica is a shining example of excellence in closed-source software and I have no problem with it as such, but calling it "open" because there is a web version is just disingenuous b.s.

[1] http://www.wolfram.com/products/mathematica/newin7/content/D...

[2] http://www.wolfram.com/mathematica/new-in-8/probability-and-...

Post reply on HN