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

• `r` the current radius between 0 and 1
• `n` negate the previous value
• `m` absolute 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 values
• `d` duplicate the previous value
• `s` take the sine of the previous value
• `c` take the cosine of the previous value
• `e` Raise the second-to-last value to the last value
• `P` Pi

I use a similar expression format in other places: