p5.js | rotate() function
The rotate() function in p5.js is used to rotate a shape or the object using p5.js to a specified axis over a specified angle.
Parameters: The function accepts single parameter as mentioned above and described below:
- angle: The angle of rotation which specified in radians or degrees.
- axis: the axis to rotate around
Below program illustrates the rotate() function in p5.js: