bezier()
Purpose
Used to draw quadratic bezier curves
Description
A Bezier curve (pronounced [bezje] in French) is a parametric curve used in computer graphics and related fields.
Syntax
point = bezier( point1, point2, point3, factor )
point = bezier( point1, point2, point3, point4, factor )
Arguments
point1 The first point
point2 The second point
point3 The third point
point4 Optional fourth point
factor interpolation factor
point A point on the bezier curve
Example
a = 0
c = { gWidth() /2 , gHeight() / 2 }
p1 = { 0, gHeight() / 2 }
p3 = { gWidth(), gHeight() / 2 }
loop
clear()
p2 = c + sincos( a ) * ( gHeight() /2 )
op = p1
for i = 0 to 16 loop
p = bezier( p1, p2, p3, i / 15 )
line( op, p, white )
op = p
repeat
a + = 0.01
update()
repeat
Associated Commands