# Symbolic representation of a Bézier curve

The Bézier curve is defined by:

$$C(t)=\sum_{i=0}^{n} {{n}\choose{i}} t^i (1-t)^{n-i} P_i$$

where the $P_i$ are the control points.

I am trying to write it down in Mathematica. What I have is:

p0 = {0, 0};
p1 = {1, 1};
p2 = {2, 1};
p3 = {3, -1};
p = {p0, p1, p2, p3};

c[t_, n_] := \!$$\*UnderoverscriptBox[\(\[Sum]$$, $$i = 0$$, $$n$$]$$Binomial[n, i] \*SuperscriptBox[\(t$$, $$i$$]
\*SuperscriptBox[$$(1 - t)$$, $$n - i$$] p[$$[i]$$]\)\)


I can't manage to get a proper list for plotting. Can anyone please advise on how to correctly formulate the equations?

Here is how to manually implement a Bézier curve:

p = {{0, 0}, {1, 1}, {2, 1}, {3, -1}};
n = Length[p] - 1;

ParametricPlot[Sum[p[[i + 1]] Binomial[n, i] t^i (1 - t)^(n - i), {i, 0, n}] // Evaluate,
{t, 0, 1}] To compare with the built-in:

Show[%, Prolog -> {Directive[AbsoluteThickness, ColorData[97, 2]], BezierCurve[p]}] An alternative is to use BezierFunction. Your example:

p = {{0,0},{1,1},{2,1},{3,-1}};

ParametricPlot[BezierFunction[p][t], {t, 0, 1}] 