Reference+
Name
bezierPoint()
Description
Evaluates the Bezier at point t for points a, b, c, d. The parameter t varies between 0 and 1, a and d are points on the curve, and b and c are the control points. This can be done once with the x coordinates and a second time with the y coordinates to get the location of a Bézier curve at t.
Examples
size(400,400); noFill(); bezier(340, 80, 40, 40, 360, 360, 60, 320); fill(255); int steps = 10; for (int i = 0; i <= steps; i++) { float t = i / float(steps); float x = bezierPoint(340, 40, 360, 60, t); float y = bezierPoint(80, 40, 360, 320, t); ellipse(x, y, 10, 10); }
Syntax
bezierPoint(a, b, c, d, t)
Parameters
a
(float)
coordinate of first point on the curveb
(float)
coordinate of first control pointc
(float)
coordinate of second control pointd
(float)
coordinate of second point on the curvet
(float)
value between 0 and 1
Return
float
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.