7 ms·
Show HN: A Sierpinski Valentine in 4 equations
- splike 12y agoHow the heck do people come up with these equations? Is it purely mathematical knowledge, knowing what functions look like when plotted?
- azeirah 12y agoBy playing around, usually. See https://www.youtube.com/watch?v=Zkx1aKv2z8o https://www.youtube.com/watch?v=Zkx1aKv2z8o Specifically from 4:30 to 7~
- electronvolt 12y agoI think it's a combination of playing around and math chops. Without any mathematical knowledge, you probably couldn't come up with something like the s(i,k,o) function (which, as far as I can tell from just looking/playing around with them briefly, seems to be the function responsible for the tessellation offset), and you might not have thought to define a system like (x=X(N,t), y=Y(N,t), 0<t<1). Without a nontrivial amount of playing around, you probably wouldn't have found the exact constants used, like (2pi(3^i)), .2/(2^i), etc.--but knowing how altering those affects the end result takes some mathematical knowledge, so it's more guided investigation than random guessing.
- harmonium1729 12y agoYeah - I think it'd take some serious chops to construct this from scratch (note: it wasn't me! author: twitter.com/teachwithcode). But I've been having a blast deconstructing the equations. Here's a fun intermediate step (circles instead of hearts), with a few of the numbers parametrized as sliders: https://www.desmos.com/calculator/irg4qa2s4h https://www.desmos.com/calculator/irg4qa2s4h [disclaimer: I work at desmos]
- meta_pseudo 12y agoThere are iterated function systems (IFS) for constructing such fractals, Sierpinski gasket is in fact quite common.
- jwmerrill 12y agoYou can send this graph as a valentine, or make your own at http://mathogram.desmos.com/ http://mathogram.desmos.com/ Disclosure: I'm one of the engineers at Desmos.
- deleted 12y ago[deleted]
- JohnHammersley 12y agoThis is very cool - both Desmos itself and the Sierpinkski Valentine example! In case you're more familar with LaTeX, you can also create similar visualizations in LaTeX using the 'lindenmayersystems' libary and TikZ. Here's a quick example: https://www.overleaf.com/latex/examples/the-first-six-levels-of-the-sierpinski-triangle/gqwmqrhmphxv https://www.overleaf.com/latex/examples/the-first-six-levels...
- joshu 12y agocan i extract an svg of this? that would let me CNC it.
- darklajid 12y agoUnsupported browser. Desmos works best on your version of Android if you use the Chrome Browser. (Close page in Aurora, no clue what "Desmos" is but I don't care by now)
- lion_del 12y agoVery cool!