Spirals
Define your own spiral as a function that takes the current radius and returns the current angle in radians
Your function is run for several evenly-distributed radii between 0 and 1. The number of sampled radii increases with time, which leads to interesting animations.
Inspired in part by "The Hypnotic World of Degenerate Spirals"
Functions are defined using a "Reverse Polish Notation" syntax. Here are the different operations it supports:
rthe current radius between 0 and 1nnegate the previous valuemabsolute value of the previous value+add the previous two values*multiply the previous two values-subtract the previous value from the one before it/divide the previous value from the one before it&bitwise-and the previous two values|bitwise-or the previous two values^bitwise-xor the previous two valuesdduplicate the previous valuestake the sine of the previous valuectake the cosine of the previous valueeRaise the second-to-last value to the last valuePPi
I use a similar expression format in other places: