Clear[B0,B1,B2,B3,C1,C2,C3]; 
B0[x_] = If[ 0<= x && x <1, 1,0]; 
B1[x_] = If[0 <= x  && x <2, x B0[x]+
 (2-x) B0[x-1], 0];
B2[x_] = If[0 <= x  && x <3, x B1[x]/2+
 (3-x) B1[x-1]/2, 0];
B3[x_] = If[0 <= x  && x <4, x B2[x]/3+
 (4-x) B2[x-1]/3, 0];
C3[x_] = (1-x)^3 B0[x];
C2[x_] = x(1-x)(2-3x/2) B0[x]+
 (2-x)^2 B1[x]/4;
C1[x_] = x^2(1-x)B0[x]/2 +
   x(2-x)B1[x]/4 + (3-x)B2[x]/3;

Plot[{C1[x],C2[x], C3[x], B3[x],
 C1[4-x],C2[4-x], C3[4-x]}, {x, 0,4}]

Off[General::spell1]; 
Clear[Bspline,XY0,t];
Bspline[XY0_,t_] := 
Block[{n,XY},
  XY = XY0;
  n = Length[XY]-3;
  Clear[B];
  B[t] = XY[[1]]C3[n*t]+
    XY[[2]]C2[n*t]+ XY[[3]] C1[n*t]+
  Sum[XY[[i+3]]B3[n*t-i+1],{i,n-3}]+
   XY[[n+1]]C1[n-n*t]+XY[[n+2]]*
    C2[n-n*t]+ XY[[n+3]]C3[n-n*t];
 Return[B[t]];];
 On[General::spell1];

Clear[XY, B, BX, BY]; 
XY = {{0.,0.2},{1.,0.},{2.,0.2}, 
{3.,1.},{4.,1.3},{5.,1.3}, {6.,1.},
 {5.,0.8}};  
B[t_] = Bspline[XY,t];
BX[t_] = B[t][[1]];
BY[t_] = B[t][[2]];

Clear[dots]; 
dots = ListPlot[XY,PlotStyle->{PointSize[0.02]},DisplayFunction->Identity];
gr = ParametricPlot[{BX[t],BY[t]},{t,0,1},DisplayFunction->Identity];
txt = StringForm["Bspline Curve and Control Points"];
Show[gr,Graphics[Line[XY]],dots, 
DisplayFunction->$DisplayFunction,
Axes->False, PlotLabel->txt];

Clear[XY, B, BX, BY];
XY = {{5.,0.5},{3.5,0.2},{2.,0.5}, 
{3.,1.},{4.,1.3},{5.,1.3}, {6.,1.},
{5.,0.5}};
B[t_] = Bspline[XY,t];
BX[t_] = B[t][[1]];
BY[t_] = B[t][[2]];

Clear[dots];  
dots = ListPlot[XY,PlotStyle->{PointSize[0.02]},DisplayFunction->Identity];
gr = ParametricPlot[{BX[t],BY[t]},{t,0,1},DisplayFunction->Identity];
txt = StringForm["Bspline Curve and Control Points"];
Show[gr,Graphics[Line[XY]],dots,
DisplayFunction->$DisplayFunction,
Axes->False, PlotLabel->txt];

Clear[XY, B, BX, BY];
XY = {{-1,4},{-0.8,0},{-1.5,-6},
  {-1.8,-5}, {-1.5,-3},{-0.5,-5},
  {0,-4},{0.7,2}, {0,7},{-1,8},
  {-1.5,2},{0,-8}};
B[t_] = Bspline[XY,t];
BX[t_] = B[t][[1]];
BY[t_] = B[t][[2]];

curve=ParametricPlot[{BX[t],BY[t]},{t,0,1}, Axes->False,AspectRatio ->1];

nodes=ListPlot[XY,Frame->False,Axes->False, PlotStyle->PointSize[.02],DisplayFunction->Identity]; 
Show[curve,nodes,Graphics[Line[XY]], 
DisplayFunction->$DisplayFunction]

Clear[XY, B, BX, BY];
XY = {{4,-0.5},{3.6,0},{3.25,0}, 
{3.2,0.1}, {3.25,0.2},{3.6,0.3},
{3.75,1.2},{4.1,1.3}, {4.5,0},
{4,-0.5}};
B[t_] = Bspline[XY,t];
BX[t_] = B[t][[1]];
BY[t_] = B[t][[2]];

curve=ParametricPlot[{BX[t],BY[t]},{t,0,1}, Axes->False];

nodes=ListPlot[XY,Frame->False,Axes->False, PlotStyle->PointSize[.02],
DisplayFunction->Identity]; 
Show[curve,nodes,Graphics[Line[XY]], 
DisplayFunction->$DisplayFunction]

Clear[XY,n];
XY = {{0.,0.}, {1.2,1.2}, {8.,1.2},
{10.,4.},{15.,4},{20.,4.}, {22.,2},
{27.5,2.}, {28.,0}};
B[t_] = Bspline[XY,t];
BX[t_] = B[t][[1]];
BY[t_] = B[t][[2]];

curve=ParametricPlot[{BX[t],BY[t]},{t,0,1}, Axes->False,AspectRatio->0.3]

nodes=ListPlot[XY,Frame->False,Axes->False, AspectRatio->0.3,PlotStyle->
PointSize[.02],
DisplayFunction->Identity]; 
Show[curve,nodes, Graphics[Line[XY]], DisplayFunction->$DisplayFunction]