p5.js Constants QUARTER_PI
Last Updated :
16 Aug, 2023
The QUARTER_PI is a mathematical constant with the value 0.7853982. It is one quarter the ratio of the circumference of a circle to its diameter.
Syntax:
QUARTER_PI
Below program illustrates the QUARTER_PI constant in p5.js:
Example: This example describes the QUARTER_PI constant.
function setup() {
createCanvas(880, 300);
}
function draw() {
background(220);
stroke(255, 204, 0);
strokeWeight(4);
arc(50, 50, 280, 280, 0, QUARTER_PI/2);
noStroke();
textSize(20);
text( "Value of QUARTER_PI is "
+ QUARTER_PI, 30, 150);
}
|
Output:
Reference: https://p5js.org/reference/#/p5/QUARTER_PI
Share your thoughts in the comments
Please Login to comment...