# 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:

the current radius between 0 and 1`r`

negate the previous value`n`

absolute value of the previous value`m`

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 values`^`

duplicate the previous value`d`

take the sine of the previous value`s`

take the cosine of the previous value`c`

Raise the second-to-last value to the last value`e`

Pi`P`

I use a similar expression format in other places: