[][src]Static p5_sys::global::bezier

pub static bezier: BezierInternalType

Draws a cubic Bezier curve on the screen. These curves are defined by a series of anchor and control points. The first two parameters specify the first anchor point and the last two parameters specify the other anchor point, which become the first and last points on the curve. The middle parameters specify the two control points which define the shape of the curve. Approximately speaking, control points "pull" the curve towards them.

Bezier curves were developed by French automotive engineer Pierre Bezier, and are commonly used in computer graphics to define gently sloping curves. See also curve().

Examples

noFill();
stroke(255, 102, 0);
line(85, 20, 10, 10);
line(90, 90, 15, 80);
stroke(0, 0, 0);
bezier(85, 20, 10, 10, 90, 90, 15, 80);
background(0, 0, 0);
noFill();
stroke(255);
bezier(250, 250, 0, 100, 100, 0, 100, 0, 0, 0, 100, 0);

Overloads

x1 x-coordinate for the first anchor point

y1 y-coordinate for the first anchor point

x2 x-coordinate for the first control point

y2 y-coordinate for the first control point

x3 x-coordinate for the second control point

y3 y-coordinate for the second control point

x4 x-coordinate for the second anchor point

y4 y-coordinate for the second anchor point


x1 x-coordinate for the first anchor point

y1 y-coordinate for the first anchor point

z1 z-coordinate for the first anchor point

x2 x-coordinate for the first control point

y2 y-coordinate for the first control point

z2 z-coordinate for the first control point

x3 x-coordinate for the second control point

y3 y-coordinate for the second control point

z3 z-coordinate for the second control point

x4 x-coordinate for the second anchor point

y4 y-coordinate for the second anchor point

z4 z-coordinate for the second anchor point