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