Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Compute the control points of a Bézier curve that interpolates a given set of points
ResourceFunction["BezierInterpolatingControlPoints"][{x1,x2,…},{f1,f2,…}] gives the Bernstein basis coefficients of the interpolating polynomial for the function values fi corresponding to x values xi. | |
ResourceFunction["BezierInterpolatingControlPoints"][{t1,t2,…},{{x1,y1,…},{x2,y2,…},…}] generates the control points for a full-degree interpolating Bézier curve with interpolation nodes ti and points {xi,yi,…}. |
A list of points:
In[1]:= | ![]() |
Get the coefficients of the Bézier interpolant:
In[2]:= | ![]() |
Out[2]= | ![]() |
Plot the Bézier interpolant along with the points:
In[3]:= | ![]() |
Out[3]= | ![]() |
A set of points to interpolate:
In[4]:= | ![]() |
Generate the Bézier control points:
In[5]:= | ![]() |
Out[5]= | ![]() |
Show the Bézier curve along with the points:
In[6]:= | ![]() |
Out[6]= | ![]() |
Use BezierInterpolatingControlPoints to generate an interpolating Bézier surface patch:
In[7]:= | ![]() |
Out[7]= | ![]() |
In[8]:= | ![]() |
Out[8]= | ![]() |
With inexact inputs, the result of BezierInterpolatingControlPoints is usually more accurate than using LinearSolve with BernsteinBasis:
In[9]:= | ![]() |
Out[9]= | ![]() |
In[10]:= | ![]() |
Out[10]= | ![]() |
In[11]:= | ![]() |
Out[11]= | ![]() |
In[12]:= | ![]() |
Out[12]= | ![]() |
This work is licensed under a Creative Commons Attribution 4.0 International License