Loading

PbezierPoint

processing

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 bezier curve at t.

Link to original Processing doc

PbezierPoint is available since version 1.0.0.

See also

Signatures

Examples

// @preview image //draw ellipses along the curve 300 200 '2D3' PGraphics 255 Pbackground 16 PtextSize 50 'x1' STORE 50 'y1' STORE 200 'x2' STORE 130 'y2' STORE 100 'cx1' STORE 40 'cy1' STORE 110 'cx2' STORE 140 'cy2' STORE 4 PstrokeWeight $x1 $y1 Ppoint //first anchor $x2 $y2 Ppoint //second anchor 2 PstrokeWeight $x1 $y1 $cx1 $cy1 Pline $x2 $y2 $cx2 $cy2 Pline 2 PstrokeWeight 0xffff0000 Pstroke $x1 $y1 $cx1 $cy1 $cx2 $cy2 $x2 $y2 Pbezier 0 10 <% 10.0 / 't' STORE $x1 $cx1 $cx2 $x2 $t PbezierPoint 'x' STORE $y1 $cy1 $cy2 $y2 $t PbezierPoint 'y' STORE 0x9f009f00 Pfill PnoStroke 'CENTER' PellipseMode $x $y 5 5 Pellipse %> FOR Pencode