Tag Info

New answers tagged


You can also use built-in functions for splines. For instance: pts = RandomReal[{1., 10.}, {10, 2}]; f = BSplineFunction[pts]; Show[Graphics[{Red, Point[pts], Green, Line[pts]}, Axes -> True], ParametricPlot[f[t], {t, 0, 1}]]


It may be that what I've understood about your implementation is wrong (which is: to fix your code change all instances of j to i in the For loop). If this does not fix your problem, please provide more detail in your question about exactly what you are trying to do. To illustrate a more compact Mathematica-style version: n = 10; p1[x_] = 1/6*(-x^3 + 3 x^2 ...


This was solved with help from Shutao Tang, J.M., Sander Huisman and Eric Rimbey. Why do BezierFunction[pt] and BezierCurve[pt] not agree? Because BezierCurve uses SplineDegree -> 3 by default and BezierFunction always uses degree Length[pt] - 1 (not settable). Why does DiscretizeGraphics give a bad result? Because it appears to use (the equivalent ...

Top 50 recent answers are included