
Show HN: Mojulo – Pixelated Math Rendering Sandbox Toy - pokpokpok
http://maxbittker.github.io/Mojulo/
======
gecko39
attempt at some water droplets:

[http://maxbittker.github.io/Mojulo/#MTAgICsgMTY1ICogc2luKDIu...](http://maxbittker.github.io/Mojulo/#MTAgICsgMTY1ICogc2luKDIuNSsgKHktNTApIC8gMjYgKSArIDkwKnNpbiggdGltZSowLjcgLSAoKDAuMSooIHggLSA1MCApXjIgKyAoeS01MCleMiApXjAuNDUpICkgLSAyNTUgKiAoMSArICgoKHgtMSkgJSA1MCkgLSAoeCAlIDUwKSkpICogKDEgKyAoKCAoeSszMC0odGltZSUxOCktMSkgJSAxMCkgLSAoICh5KzMwLSh0aW1lJTE4KSkgJSAxMCkpKSAqICgoeSU1MCkgKyAoNTAteSklNTAp)

~~~
leni536
This is freaking awesome.

------
boulos
I like the time element! A friend from my old days got really into algorithmic
art
([http://dahart.com/paper/hart_evomusart_2007_paper.pdf](http://dahart.com/paper/hart_evomusart_2007_paper.pdf))
you should consider including exp/ln and others. He's got some nice examples
on his webpage ([http://dahart.com/blot1.html](http://dahart.com/blot1.html)).

~~~
pokpokpok
Thanks, these are inspiring. Makes me want to add genetic mechanics.

------
Tideflat
Here is a basic thobber:

    
    
      ((cos(time/2)+1)*x)+((cos((time-(3.141*2))/2)+1)*(100-x))
    

[https://maxbittker.github.io/Mojulo/#KChjb3ModGltZS8yKSsxKSp...](https://maxbittker.github.io/Mojulo/#KChjb3ModGltZS8yKSsxKSp4KSsoKGNvcygodGltZS0oMy4xNDEqMikpLzIpKzEpKigxMDAteCkp)

Here is using the same trick to switch between two patterns:

    
    
      ((cos(time/50)+1)*(A*1000))+((cos((time-(3.141*50))/50)+1)*((x-50)^2+(y-50)^2))
    

[https://maxbittker.github.io/Mojulo/#KChjb3ModGltZS81MCkrMSk...](https://maxbittker.github.io/Mojulo/#KChjb3ModGltZS81MCkrMSkqKEEqMTAwMCkpKygoY29zKCh0aW1lLSgzLjE0MSo1MCkpLzUwKSsxKSooKHgtNTApXjIrKHktNTApXjIpKQ==)

Unfortunately, this trick doesn't work well with patterns with high values,
and thus most animated patterns don't work.

It works like this:

    
    
      ((cos(time/p)+1)*q)+((cos((time-(3.141*p))/p)+1)*Q)
    

where: p is the speed of the switch (Higher is slower), q is pattern #1, and Q
is pattern #2.

The cos(...)+1 part in both sections is in charge of timing. In the second
part we subtract pi * p, which is half the period, from time to make it start
at the half point of the cycle.

~~~
pokpokpok
thanks, I appreciated this

------
smosher_
This is very similar in style to IBNIZ:
[http://pelulamu.net/ibniz/](http://pelulamu.net/ibniz/) which also does
audio.

There used to be a JS implementation hosted at
[http://ibniz.asiekierka.pl/ibniz.html](http://ibniz.asiekierka.pl/ibniz.html)
but the domain seems to have expired. The Wayback Machine has a copy though:
[https://web.archive.org/web/20120121060156/http://ibniz.asie...](https://web.archive.org/web/20120121060156/http://ibniz.asiekierka.pl/ibniz.html)

------
neuralk
Very fun, and the gallery is a nice touch. Here's my contribution:

    
    
      (r *(2*sin((-A*time)/10))^100)  * ((r * r ) % 2)
    

[http://maxbittker.github.io/Mojulo/#KHIgKigyKnNpbigoLUEqdGlt...](http://maxbittker.github.io/Mojulo/#KHIgKigyKnNpbigoLUEqdGltZSkvMTApKV4xMDApICAqICgociAqIHIgKSAlIDIp)

------
daturkel
Thought this came out pretty well:

[http://maxbittker.github.io/Mojulo/#cip0aW1lKih0aW1lKnNpbih4...](http://maxbittker.github.io/Mojulo/#cip0aW1lKih0aW1lKnNpbih4KS0xL3RpbWUqc2luKHkpKQ)

Speeding it up (increase the first "time" to "time^9") you can see that it
eventually "heats up" all the way to black, but it's a nice journey.

Edit: also this one has a nice strobe. You can strobe any pattern you make by
replacing a time with some variant of B*sin(time/C) where B and C are
appropriately chosen coefficients.

[https://maxbittker.github.io/Mojulo/#MTAwKnNpbih0aW1lLzEwKSp...](https://maxbittker.github.io/Mojulo/#MTAwKnNpbih0aW1lLzEwKSpyICUgMTAwMDA=)

------
jpallen
Nice! After playing with it for a bit too long, this was my favourite:

    
    
        sin(time * 0.2) * cos(time * 0.1) * (125+125*sin(0.01*(2 + sin(0.6*time)*cos(0.4*time))*((- 50 + x + 20 * cos(0.5*time))^2 + (- 50 + y + 20 * sin(0.3*time))^2)))

~~~
pokpokpok
Neat! Haven't teased anything like this out of it yet so thanks for sharing,
I'll add it to the gallery. Linking works by the way:

[https://maxbittker.github.io/Mojulo/#ICAgIHNpbih0aW1lICogMC4...](https://maxbittker.github.io/Mojulo/#ICAgIHNpbih0aW1lICogMC4yKSAqIGNvcyh0aW1lICogMC4xKSAqICgxMjUrMTI1KnNpbigwLjAxKigyICsgc2luKDAuNip0aW1lKSpjb3MoMC40KnRpbWUpKSooKC0gNTAgKyB4ICsgMjAgKiBjb3MoMC41KnRpbWUpKV4yICsgKC0gNTAgKyB5ICsgMjAgKiBzaW4oMC4zKnRpbWUpKV4yKSkp)

------
gecko39
zoomy checkerboard by summing a few sinusoids

[http://maxbittker.github.io/Mojulo/#NDAqKHNpbigoeC01MCkvKDQr...](http://maxbittker.github.io/Mojulo/#NDAqKHNpbigoeC01MCkvKDQrc2luKHRpbWUvMikpKSArICgxLzMpKnNpbigzKih4LTUwKS8oNCtzaW4odGltZS8yKSkpICsgKDEvNSkqc2luKDUqKHgtNTApLyg0K3Npbih0aW1lLzIpKSkpICogKHNpbigoeS01MCkvKDQrc2luKHRpbWUvMikpKSArICgxLzMpKnNpbigzKih5LTUwKS8oNCtzaW4odGltZS8yKSkpICsgKDEvNSkqc2luKDUqKHktNTApLyg0K3Npbih0aW1lLzIpKSkpIA==)

------
lohankin
Behavior becomes more interesting if you replace (in any formula) time with
(time+sin(time)) - and, more generally, with (time+k _sin(w_ time))

------
pokpokpok
I encourage people to check out and contribute to the gallery, I built this
because I wanted to see the amazing things people come up with!

~~~
gecko39
here's one:

    
    
      10*((((100-x)^2+y^2)^0.5 + time) % 10) + 10*((((x)^2+y^2)^0.5 + time) % 10)

~~~
pokpokpok
linked for the lazy:

[https://maxbittker.github.io/Mojulo/#ICAxMCooKCgoMTAwLXgpXjI...](https://maxbittker.github.io/Mojulo/#ICAxMCooKCgoMTAwLXgpXjIreV4yKV4wLjUgKyB0aW1lKSAlIDEwKSArIDEwKigoKCh4KV4yK3leMileMC41ICsgdGltZSkgJSAxMCk=)

fantastic effect! One of my favorites today, thank you. Quick question - do
you think that I should refine the gallery formatting to include attribution?
It's a bit of a "discovery vs invention" type quandary

~~~
nacs
Just wanted to mention, that gallery link is barely noticeable because of the
blue color. I didn't notice it on multiple visits till you mentioned there was
a gallery.

Changing the link color should fix it.

~~~
pokpokpok
haha it's always been purple for me because it's a clicked link! no wonder
nobody can find it. thank you

------
leni536
Ok, I'm getting addicted.

[http://maxbittker.github.io/Mojulo/#LTIwMDAwMDAwKigoc2luKCgo...](http://maxbittker.github.io/Mojulo/#LTIwMDAwMDAwKigoc2luKCgoeC01MCkqKHgtNTApK3kqeSleMC41LzUtdGltZS84LjA5KStzaW4oKCh4LTUwKSooeC01MCkrKHktMTAwKSooeS0xMDApKV4wLjUvNS10aW1lLzUpKzIpLzQpXjIwMA==)

------
leni536
I like interference:

[http://maxbittker.github.io/Mojulo/#MTI3MDAwMCooY29zKHIvNi10...](http://maxbittker.github.io/Mojulo/#MTI3MDAwMCooY29zKHIvNi10aW1lLzEwKS9yK2NvcygoeCp4Kyh5LTEwMCkqKHktMTAwKSleMC41LzYtdGltZS8xMCkvKHgqeCsoeS0xMDApKih5LTEwMCkpXjAuNSsxKQ==)

------
Zolomon
This looks kind of cool:

rand()/rand() * cos(time)^2 * 127

and

rand()/rand() * cos(time/rand())^2 * sin(time/rand())^2 * 127

------
Tideflat
Flames:
[http://maxbittker.github.io/Mojulo/#KC0zMCt5KygoKHNpbigoeC0x...](http://maxbittker.github.io/Mojulo/#KC0zMCt5KygoKHNpbigoeC0xMCkvNStzaW4odGltZSt5LzYpKSoxMDApKzEwMCkpKi0xKQ==)

------
prezjordan
Very cool! If you combined this with something like blockly[0] I bet it'd
inspire quite a few kids.

[0]: [https://code.google.com/p/blockly/](https://code.google.com/p/blockly/)

~~~
pokpokpok
good idea! this project was partially inspired by math classes spent in high
school plotting pretty polar functions on my graphing calculator instead of
paying attention to trigonometry... I'm not sure that mojulo in it's current
form will be a useful educational tool but I think that toys similar to this
are a great way to impress upon kids a sense of different functions they
usually only encounter on paper

------
joshu
I've been CNCing algorithmic output a lot lately. I write something very
similar (no time component, but basically evaluated over the unit square.)

This stuff is a ton of fun!

------
xellisx
(sin(-x * y) / cos(x * -y)) ^ (time % (r + A))

------
gecko39
kinda psychedelic -- stare at it for a while:

[http://maxbittker.github.io/Mojulo/#MjUwICogKCgoKCh4LTUwKV4y...](http://maxbittker.github.io/Mojulo/#MjUwICogKCgoKCh4LTUwKV4yICsgKHktNTApXjIpKjAuMjUpICUgKDEuMSt0aW1lLzEwMDAwLjApICleMTApIC0gKCgoKCh4LTUwKV4yICsgKHktNTApXjIpKjAuMjUpICUgKDEuMDI1ICsgdGltZS8yMDAwLjApICleMjApXjEw)

------
coldcode
sin(r/x) * y * time^2+rand()^y is a nicely non-repeating result

------
muyuu
x * y * (sin(x+time) * cos(y+time) * time/2)

~~~
pokpokpok
cool, my slight modification:
[http://maxbittker.github.io/Mojulo/#eCAqIHkgKiAoc2luKCh4K3Rp...](http://maxbittker.github.io/Mojulo/#eCAqIHkgKiAoc2luKCh4K3RpbWUpLzEwKSAqIGNvcygoeSt0aW1lKS8xMCkgKiB0aW1lLzIp)

~~~
aperiodic
More constant tweaking:

x * y * (sin((x+time)/5) * cos((y+time)/5)) * 15 + 3000

[http://maxbittker.github.io/Mojulo/#IHggKiB5ICogKHNpbigoeCt0...](http://maxbittker.github.io/Mojulo/#IHggKiB5ICogKHNpbigoeCt0aW1lKS81KSAqIGNvcygoeSt0aW1lKS81KSkgKiAxNSArIDMwMDA=)

