home/ atoms/ tan-wave-animation

A tan() wave drives motion that shoots off-screen and returns from the opposite side, unlike a bounded sin() wave

Driving a position with map(sin(radians(frameCount)), -1, 1, a, b) gives bounded oscillation: the value stays inside [a,b]. Using tan() instead produces values that grow without bound near the asymptote and then wrap back from the opposite extreme, so an element slides far off the canvas and re-enters from the other edge. Rodenbröker exploits this for typographic motion — text travels out of the poster then returns from the other side, a different feel from the gentle back-and-forth of a sine wave. frameCount as the radians argument makes the loop continuous; the map range sets how far the element travels before wrapping.

Examples

float wave = map(tan(radians(frameCount)), -1, 1, -tw/2, tw/2); translate(wave, 0); // text exits one side, reappears from the other

Assessment

What is the visual difference between animating position with a sin() wave versus a tan() wave, and when would you choose tan()?

“tan wave tan waves are very powerful they are very very cool”
corpus · programming-posters-processing-tutorial-tim-rodenbroker-free · chunk 2