p5.js | sq() function
The sq() function in p5.js is used to calculate the square value of a number. The square of a number is always positive.
Parameters: The function accepts only one parameter as mentioned above and described below:
Below program illustrates the sq() function in p5.js: