Learn creative coding writing simple programs

46. Create beautiful curves with lots of sin() calls

Now we use the sin() function to control many different properties. We animate circles moving on the screen. Their X and Y position is calculated using the sine function. The size, hue and brightness of each circle is also calculated with different formulas that use sin(). This trigonometric function by default gives a very simple and predictable result. But when we combine multiple sin() calls we can get more complex graphics, but which still change in a smooth way.

Tags: sin, graphics, trigonometry, math, draw, animate, animation

Code editor

You can make changes to the code below. Then
Below you can ask and answer questions related to this video. If your question is unrelated to the video, please post it at the Processing Forum as I'm unable to help with all of your programs and still have enough free time to eat and sleep :)
comments powered by Disqus