Name

TWO_PI

Description

TWO_PI is a mathematical constant with the value 6.2831855. It is twice the ratio of the circumference of a circle to its diameter. It is useful in combination with the trigonometric functions sin() and cos().

Examples

  • float x = width/2;
    float y = height/2;
    float d = width * 0.8;
    size(400,400);
    arc(x, y, d, d, 0, QUARTER_PI);
    arc(x, y, d-80, d-80, 0, HALF_PI);
    arc(x, y, d-160, d-160, 0, PI);
    arc(x, y, d-240, d-240, 0, TWO_PI);
    
    Image output for example 1