The current time can be read with the second(), minute(), and hour() functions. This example uses map() to calculate the angle of the hands. It then uses transformations to set their position.
No alt text
Linear Interpolation
Convert a number between 0 and 1 to another range.
Map
Convert a number from one range to another range.
Random
Get random numbers.
Constrain
Keep a number within a range.
Clock
Get the current time.
Looking for the old p5.js site? Find it here!