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 ?
- p5.js | abs() function
- p5.js | sin() function
- D3.js zip() Function
- p5.js | arc() Function
- PHP | ord() Function
- p5.js | cos() function
- p5.js | sq() function
- p5.js | log() function
- CSS env() Function
- PHP | end() Function
- PHP | pos() Function
- p5.js | tan() function
- p5.js | hue() function
- CSS | hsl() Function
- CSS min() Function
- PHP | each() 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 firstname.lastname@example.org. 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.