# P5 js V 2.0.5 bezierVertex error

**URL:** <https://discourse.processing.org/t/p5-js-v-2-0-5-beziervertex-error/47182>\
**Category:** Beginners\
**Created:** [September 21, 2025, 5:41am UTC](https://discourse.processing.org/t/p5-js-v-2-0-5-beziervertex-error/47182 "2025-09-21T05:41:02Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![RPI](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/rpi/32/21110_2.png) [@RPI](https://discourse.processing.org/u/RPI)\
**Post date:** [September 21, 2025, 5:41am UTC](https://discourse.processing.org/t/p5-js-v-2-0-5-beziervertex-error/47182/1 "2025-09-21T05:41:02Z")

</div>

![Screenshot From 2025-09-21 10-05-41](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/4/e/4e04e20d1cecdf2300ccf984c9e93d56daca8d63.png)

[code in online editor](https://editor.p5js.org/RPI/sketches/5at0aG-EK)

---

<div class="post-metadata">

**Author:** ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)\
**Post date:** [September 21, 2025, 7:27am UTC](https://discourse.processing.org/t/p5-js-v-2-0-5-beziervertex-error/47182/2 "2025-09-21T07:27:48Z")

</div>

Welcome to the forum.

The error message states

> Expected at most 5 arguments, but received more in bezierVertex(). For more information,

and you had six arguments. The [reference](https://beta.p5js.org/reference/p5/beziervertex/) shows that this function expects any where from 2 to 5 parameters.

---

<div class="post-metadata">

**Author:** ![RPI](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/rpi/32/21110_2.png) [@RPI](https://discourse.processing.org/u/RPI)\
**Post date:** [September 21, 2025, 7:29am UTC](https://discourse.processing.org/t/p5-js-v-2-0-5-beziervertex-error/47182/3 "2025-09-21T07:29:35Z")

</div>

pls just compare  
switching the p5.js version back to

p5.js V1 xx  
and it works

---

<div class="post-metadata">

**Author:** ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)\
**Post date:** [September 21, 2025, 7:41am UTC](https://discourse.processing.org/t/p5-js-v-2-0-5-beziervertex-error/47182/4 "2025-09-21T07:41:23Z")

</div>

> [@RPI](#):
>
> p5.js V1 xx  
> and it works

So it did 😁

V2 has introduced some breaking changes.

It looks to me that in V1 bezierVertex can accept multiple points hence in your example 3 points (6 arguments), in V2 it can only accept 1 point. So it you change the code

to

```auto
  beginShape(); // ________________________ Start drawing the shape.
  vertex(30, 20); // ______________________ Add the first anchor point.
  bezierVertex(80, 0); // _ Add the Bézier vertex.
  bezierVertex(80, 75); // _ Add the Bézier vertex.
  bezierVertex(30, 75); // _ Add the Bézier vertex.
  endShape(); // __________________________ Stop drawing the shape.

```

It will work in V2

---

<div class="post-metadata">

**Author:** ![RPI](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/rpi/32/21110_2.png) [@RPI](https://discourse.processing.org/u/RPI)\
**Post date:** [September 21, 2025, 7:49am UTC](https://discourse.processing.org/t/p5-js-v-2-0-5-beziervertex-error/47182/5 "2025-09-21T07:49:19Z")

</div>

the new code style and documentation completely ignores the difference between

anchor points and ?control points?

> bezierVertex(80, 0); // \_\_**\_ control point ( angle adjust )  
> bezierVertex(80, 75); // \_**\_ control point ( angle adjust )

---

<div class="post-metadata">

**Author:** ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)\
**Post date:** [September 21, 2025, 8:12am UTC](https://discourse.processing.org/t/p5-js-v-2-0-5-beziervertex-error/47182/6 "2025-09-21T08:12:07Z")

</div>

I have rarely if ever used the `bezier???(...)` functions and the documentation for `bezierVertex` for V2 is as clear as mud so I can’t comment further.

> [@RPI](#):
>
> … the difference between anchor points and ?control points?

There is no real difference between them. A Bezier curve can be made with any number of control points ≥3

The curve will pass through the first and last point (traditionally called anchor points) but not the intermediate points (traditionally called control points) as these simply control the path of the curve .

The best known curve is the cubic Bezier with 4 points and is of order 3 (order = nbrPoints -1) and along with the quadratic Bezier (3 points, order 2) and are the ones most commonly used in computer graphics.

There is no upper limit to the order of a Bezier curve but the effort to calculate the curves path / shape increases rapidly with the order.

---

<div class="post-metadata">

**Author:** ![davepagurek](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/davepagurek/32/17535_2.png) [@davepagurek](https://discourse.processing.org/u/davepagurek)\
**Post date:** [September 21, 2025, 1:54pm UTC](https://discourse.processing.org/t/p5-js-v-2-0-5-beziervertex-error/47182/7 "2025-09-21T13:54:24Z")

</div>

Just to add on to what @quark has already explained: the other benefit of breaking up points into multiple calls is that you can change other p5 state in between calls! e.g. changing the stroke color:

```js
function setup() {
  createCanvas(400, 400, WEBGL);
}

function draw() {
  background(0);
  
  translate(-width/2, -height/2)
  noFill()
  strokeWeight(8)
  
  beginShape()
  stroke('red')
  bezierVertex(20, 20)
  stroke('yellow')
  bezierVertex(280, 20)
  stroke('lime')
  bezierVertex(280, 280)
  stroke('cyan')
  bezierVertex(20, 280)
  endShape()
}

```

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/c/7/c70a8cd4a9db601be6bbd9e3d4d5e6b87b148efd.png)

Live: [Clumsy expert by davepagurek -p5.js Web Editor](https://editor.p5js.org/davepagurek/sketches/x-PsWKJsP)

---

<div class="post-metadata">

**Author:** ![RPI](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/rpi/32/21110_2.png) [@RPI](https://discourse.processing.org/u/RPI)\
**Post date:** [September 22, 2025, 12:16am UTC](https://discourse.processing.org/t/p5-js-v-2-0-5-beziervertex-error/47182/8 "2025-09-22T00:16:17Z")

</div>

thanks, that seems to be a impressive WEBGL feature,

( so not work in my example, only the last selected color is used for the line between the 2 anchor points )

---

<div class="post-metadata">

**Author:** ![RPI](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/rpi/32/21110_2.png) [@RPI](https://discourse.processing.org/u/RPI)\
**Post date:** [September 22, 2025, 1:28pm UTC](https://discourse.processing.org/t/p5-js-v-2-0-5-beziervertex-error/47182/9 "2025-09-22T13:28:52Z")

</div>

that is the shape i was looking for:

[online editor bezier shape](https://editor.p5js.org/RPI/full/VegJzePY9)

thanks again for your help.

---

<div class="post-metadata">

**Author:** ![davepagurek](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/davepagurek/32/17535_2.png) [@davepagurek](https://discourse.processing.org/u/davepagurek)\
**Post date:** [September 22, 2025, 1:47pm UTC](https://discourse.processing.org/t/p5-js-v-2-0-5-beziervertex-error/47182/10 "2025-09-22T13:47:48Z")

</div>

Cool! Making some sankey diagrams?

---

<div class="post-metadata">

**Author:** ![RPI](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/rpi/32/21110_2.png) [@RPI](https://discourse.processing.org/u/RPI)\
**Post date:** [September 23, 2025, 2:02am UTC](https://discourse.processing.org/t/p5-js-v-2-0-5-beziervertex-error/47182/11 "2025-09-23T02:02:36Z")

</div>

how you know?

 ![Firefox_Screenshot_2025-09-23T02-01-53.269Z](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/5/b/5b0be4b1d7e17f95fca6e7db8ac44a6b5fbb7837.png)
