Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App

Related Articles

p5.js | ellipse() Function

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

The ellipse() function is an inbuilt function in p5.js which is used to draw an ellipse.


ellipse(x, y, w, h)
ellipse(x, y, w, h, detail)

Parameters: This function accepts five parameters as mentioned above and described below:

  • x: This parameter takes the x-coordinate of the ellipse.
  • y: This parameter takes the y-coordinate of the ellipse.
  • w: This parameter takes the width of the ellipse.
  • h: This parameter takes the height of the ellipse.
  • detail: It is the optional parameter which takes the number of radial sectors to draw as integer.

Below program illustrates the ellipse() function in P5.js:

function setup() {
    createCanvas(400, 400);
function draw() {
    // An ellipse at 150, 150 with radius 280
    ellipse(150, 150, 280, 180) 



My Personal Notes arrow_drop_up
Last Updated : 24 Oct, 2018
Like Article
Save Article
Similar Reads
Related Tutorials