The curvePoint() function in p5.js is used to evaluate the coordinates of a curve at the given point. It takes in the coordinates of the curve for a particular axis and finds the coordinate of the curve at point “t”, which can be specified as a parameter.
The complete position of a point in the curve can be found out by finding using the function once on the x-coordinates and once on the y-coordinates of the curve and then using them together.
curvePoint( a, b, c, d, t )
Parameters: This function accepts five parameters as mentioned above and described below:
- a: It is a number that specifies the first point of the curve.
- b: It is a number that specifies the first control point of the curve.
- c: It is a number that specifies the second control point of the curve.
- d: It is a number that specifies the second point of the curve.
- t: It is a number between 0 and 1, which is used as the position between the beginning and ending of the curve coordinates.
Return Value: It returns a number which specifies the curve value at the given position.
The examples below illustrates the curvePoint() function in p5.js:
Online editor: https://editor.p5js.org/
- How to get the function name inside a function in PHP ?
- PHP | pi( ) Function
- PHP | Ds\Set contains() Function
- p5.js | nfc() function
- p5.js | mag() Function
- p5.js | nfp() Function
- p5.js | nf() Function
- D3.js | d3.set.add() Function
- PHP | pow( ) Function
- CSS | url() Function
- PHP | Ds\Set add() Function
- D3.js | d3.map.set() Function
- D3.js | d3.hcl() Function
- PHP | Ds\Set first() Function
- p5.js | box() Function
- PHP | next() Function
- PHP | Ds\Set last() Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. 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.