p5.js | Constants | TAU
The TAU is a mathematical constant and it is the alias of TWO_PI. The value of TAU is 6.28318530717958647693. It is twice the ratio of the circumference of a circle to its diameter.
Syntax:
TAU
Below program illustrates the usage of TAU in p5.js:
Example: This example illustrates the TAU constant.
function setup() { // Create Canvas of size 880*300 createCanvas(880, 300); } function draw() { //Set the background Color background(220); //Set the stroke color stroke(255, 204, 0); //Set the stroke weight strokeWeight(4); // Use of constant TAU arc(180, 50, 280, 280, 0, TAU/2); noStroke(); // Set the font size textSize(20); // Display result text( "Value of TAU is " + TAU, 30, 230); } |
chevron_right
filter_none
Output:
Reference: https://p5js.org/reference/#/p5/TAU
Recommended Posts:
- p5.js | Constants | PI
- p5.js | Constants | TWO_PI
- p5.js | Constants | HALF_PI
- PHP | Magic Constants
- p5.js | Constants | QUARTER_PI
- PHP | Defining Constants
- How to Create a Tab Image Gallery ?
- XML full form
- How to create an Affix or sticky Navbar ?
- How to add float numbers using JavaScript ?
- How to send email with Nodemailer using Gmail account in Node.js ?
- PHP | ReflectionExtension getFunctions() Function
- PHP | ReflectionExtension info() Function
- PHP | Imagick setLastIterator() Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.