39 comments

[ 4.0 ms ] story [ 82.7 ms ] thread
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!
(comment deleted)
here's one:

  10*((((100-x)^2+y^2)^0.5 + time) % 10) + 10*((((x)^2+y^2)^0.5 + time) % 10)
linked for the lazy:

https://maxbittker.github.io/Mojulo/#ICAxMCooKCgoMTAwLXgpXjI...

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

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.

haha it's always been purple for me because it's a clicked link! no wonder nobody can find it. thank you
Fan like+circling around with a long period http://maxbittker.github.io/Mojulo/#c2luKCh5KmNvcyh0aW1lLzIx...
neat, can't quite grok the mechanics behind it though
Fan is (y-50)/(x-50)+time/5, sin is to add texture. Multiplying x by cos and y by sine of the same frequency would simply rotate the fan centre around top right corner, slightly off periods (19 and 21) degenerate that circle into a more interesting Lissajous curve.
thanks for breaking it down! I'm adding it to the snazzy new gallery, and implementing Lissajous curves is going to be my new region of exploration
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/

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
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)))
This looks kind of cool:

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

and

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

Behavior becomes more interesting if you replace (in any formula) time with (time+sin(time)) - and, more generally, with (time+ksin(wtime))
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...

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

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.

(comment deleted)
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!

(sin(-x * y) / cos(x * -y)) ^ (time % (r + A))
Thought this came out pretty well:

http://maxbittker.github.io/Mojulo/#cip0aW1lKih0aW1lKnNpbih4...

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

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