top of page
WAVES
Acceleration of startAngle adding up
Oscillation is super fun! The sin and cos function transfers a linear accumulating value to a reciprocating pattern. So, waves can be made easily. The sin of an increasing variable goes up and down between -1 and 1. In each draw cycle, the computer gets the sin value of an increasing angle, then in the next draw round, the startAngle was updated, so the sin value changes, and everything move accordingly.
The angle changes in every step of the for loop and one for loop shares the same startAngle. sin(angle) can be applied to create dynamics in the same for loop. and the sin(startAngle) can be called to create dynamics between different rounds of for loops. For example, the startAngle can go up faster and faster with a startAcc.
bottom of page