Next: Path Finding, Previous: Easings, Up: Math [Contents][Index]
The (chickadee math bezier)
module provides an API for
describing cubic Bezier curves in 2D space. These curves are notably
used in font description, vector graphics programs, and when it comes
to games: path building. With Bezier curves, it’s somewhat easy to
create a smooth looking path for an enemy to move along, for example.
Bezier curves become particularly interesting when they are chained
together to form a Bezier “path”, where the end point of one curve
becomes the starting point of the next.
Return a new Bezier curve object whose starting point is p0, ending point is p3, and control points are p1 and p2. All points are 2D vectors.
Return #t
if obj is a Bezier curve.
Return the starting point of bezier.
Return the first control point of bezier.
Return the second control point of bezier.
Return the end point of bezier.
Return a list of connected bezier curves defined by control-points. The first curve is defined by the first 4 arguments and every additional curve thereafter requires 3 additional arguments.
Return the coordinates for bezier at t (a value in the range [0, 1] representing how far from the start of the curve to check) as a 2D vector.
Modify the 2D vector dest in-place to contain the coordinates for bezier at t.
Next: Path Finding, Previous: Easings, Up: Math [Contents][Index]