Converting theta into frequency Sorry for a very elementry question. It's been a long time since I took trigonometry.
In Daniel Shiffman's tutorial on drawing a sine wave in Processing, the "angular velocity" of the wave is given by "theta" (in this example "theta += 0.02;"). What is the proper equation to convert theta into frequency?
 A: After a lot of thought, I have determined why Mr. Shiffman refers to "theta" as the angular velocity. In his code, "theta" equals the x offset of the entire function each time the canvas is repainted.  A small theta causes the graph to shift a small amount so it appears to vibrate relatively slowly.  A large value of theta (less than $2\pi$) will make the wave appear to vibrate faster.
Therefore, to actually determine the frequency or angular velocity of the wave, it is necessary to know the rate at which the canvas is repainted.  That is the only quantity in this problem that is time dependent at all.  If you know that value, you can determine the frequency as follows.
The wave "moves" $\theta$ pixels every time the canvas is refreshed. So $\theta$ divided by the refresh rate actually gives you the wave's velocity in pixels per second.  The question is converting the pixels to radians.
The code defines that the wavelength (called "period" in the code for some needlessly confusing reason) at 500 pixels.  Every wavelength of a sine curve corresponds to $2\pi$ radians.
Therefore, the amount the wave propagates per cycle is:
$$\frac{2\pi\theta}{500}$$
So the angular velocity of this wave is
$$\omega=\frac{2\pi\theta}{500R}$$
Where $\omega$ is the angular velocity, $\theta$ is the shift in x, and $R$ is the refresh rate in cycles per second.
To convert from angular velocity to frequency, divide by $2\pi$
$$f=\frac{\theta}{500R}$$
