The HALF_PI is a mathematical constant and its value is 1.57079632679489661923. The HALF_PI is the half ratio of the circumference of a circle to its diameter.
Syntax:
HALF_PI
Below program illustrates the usage of HALF_PI in p5.js:
Example:
function setup() {
createCanvas(300, 200);
}
function draw() {
background(220);
stroke(255, 204, 0);
strokeWeight(4);
arc(50, 50, 280, 280, 0, HALF_PI/2);
noStroke();
textSize(20);
text( "Value of HALF_PI is "
+ HALF_PI, 30, 180);
}
|
Output:
Reference: https://p5js.org/reference/#/p5/HALF_PI
Last Updated :
16 Aug, 2023
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...