Skip to content

brothertoad/bezier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bézier interpolation

This module calculates a set of Bézier splines that represent a continuous curve through a set of points. Both integer and floating point versions are provided. I use this to create curves in SVG files.

The algorithm was ported from the Javascript on this page. The page describing what the code does is here. This page also provides a little interactive demo.

If you pass in N + 1 knots (points to be interpolated), you will get N sets of control points back, one set for each part of the curve. Each set has four control points. The first control point (P0) is the starting knot, and the last control point (P3) is the ending knot. P1 and P2 are determined by the module. A sample image is shown below, with the knots in blue and the computed control points in green.

sample SVG

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages