Connecting a set of points with smoothly connected cubic Bezier segments

Smoothly connecting a set n-d points using cubic Bezier ssegments


Updated 13 Dec 2009

View License

I have always been trying to find code in Matlab that enables one to smoothly connect arbitrary points in 2d or 3d with a smoothness condition and until recently couldnt find anything. We covered the theory in one of my classes and after working through it and some searching on the net I found a free open license C# version on

This is my Matlab version taken from there with the addition that it can be applied to points in any dimensions. The smoothness condition is simply the requirement that the first and second derivatives be equal at the joins of each segment. This does not guarantee that there will be no loops. A better version would make the smoothness requirement on the curvature.

If there is enough of a demand I will create a function that uses curvature conditioning. In the meantime however the code works well on most nicely chosen set of data points meaning that it is useful for design, not analysis.

Cite As

Aaron Wetzler (2023). Connecting a set of points with smoothly connected cubic Bezier segments (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R14
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes