p5.js | Constants | HALF_PI
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() { // Create Canvas of size 300*200 createCanvas(300, 200); } 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 HALF_PI arc(50, 50, 280, 280, 0, HALF_PI/2); noStroke(); // Set the font size textSize(20); // Display result text("Value of HALF_PI is " + HALF_PI, 30, 180); } |
chevron_right
filter_none
Output:

Reference: https://p5js.org/reference/#/p5/HALF_PI
Recommended Posts:
- p5.js | Constants | PI
- p5.js | Constants | TAU
- p5.js | Constants | TWO_PI
- p5.js | Constants | QUARTER_PI
- PHP | Defining Constants
- How to insert HTML content into an iFrame using jQuery?
- How to get the child node index in JavaScript?
- How to use jQuery in Angular ?
- How to restrict input box to allow only numbers and decimal point JavaScript?
- How to get the height of device screen in JavaScript ?
- How to get the elements of one array which are not present in another array using JavaScript?
- How do you get the length of a string in JQuery?
- How to determine which element the mouse pointer move over using JavaScript ?
- How to add innerHTML to print page?
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.



