Skip to content

how to evaluate a cubic Bezier curve (B-spline?) given the four control points

2 messages · Zack Weinberg, Greg Snow

#
I'm trying to use R to determine the quality of a cubic Bezier curve
approximation of an elliptical arc.  I know the four control points
and I want to compute (x,y) coordinates of many points on the curve.
I can't find anything in either the base distribution or CRAN that
does this; all the spline-related packages seem to be about *fitting*
piecewise Bezier curves to a data set.  Presumably, internally they
have the capability I need, but it doesn't seem to be exposed in a
straightforward way.  Help?
2 days later
#
You could look at the xspline function.  It approximates b-splines or Bezier curves given control points and shape parameters.  It can either plot the spline or return a bunch of point on the curve for comparison to other values.

Hope this helps,

--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org
801.408.8111