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
Questions and comments are welcome! :) But please try to stay close to the topic of this episode. Use the Processing forums for help with your Processing projects (or hire me for help ;-)