Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

p5.js | curveDetail() Function

  • Last Updated : 17 Jan, 2020

The curveDetail() function is used to set the resolution at which the curve will display. This function is useful when using the WEBGL renderer as the default canvas renderer does not use this information.


curveDetail( resolution )

Parameters: This function accepts single parameter resolution which holds the value of resolution. The default value of this parameter is 20 while the minimum value of this parameter is 3.

Below example illustrates the curveDetail() function in p5.js:


function setup() { 
    // Create canvas of given size
    createCanvas(500, 300, WEBGL); 
    // Set the background of canvas
    // Use curveDetail() function
function draw() { 
    // Fill the color
    // Draw the curve
    curve(50, 200, 400, -250, 40, 0, 30, 30, 100, -50, 600, 50);


Online editor:
Environment Setup:

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!