>
 

>
 

logo7.mw      Explanation will be done in class. 

> restart: with(plots):
 

> DP:= densityplot(1, x=0..2, y=0..4): DP:
 

Defining the quadratic and cubic Bezier curves, p and q respectively. 

> p[0]:=t^2: p[1]:=2*t*(1-t): p[2]:= (1-t)^2:
 

> q[0]:=t^3: q[1]:=3*t^2*(1-t): q[2]:=3*t*(1-t)^2: q[3]:= (1-t)^3:
 

Points defined by trial and error plus a bit of planning. 

> a[0]:= [0,4]: a[1]:=[1.0, 4.1]: a[2]:=[2,4]:
 

 

> b[0]:= [0.1,0]: b[1]:= [0.2,0.4]: b[2]:= [0.4, 0.9]:
 

 

> c[0]:= b[2]: c[1]:= c[0]+ 1.2*(b[2]-b[1]); #see explanation done in class
 

[.64, 1.50] (1)
 

> c[2]:= [1.6,3.5]: c[3]:= a[2]:
 

Defining the curves controlled by the corresponding 'polygons' 

> bz[1]:= sum(p[k]*a[k],k=0..2):
 

> bz[2]:= sum(p[k]*b[k],k=0..2):
 

> bz[3]:= sum(q[k]*c[k],k=0..3):
 

bz[ ] [1],  bz[ ][2]  represent the x and y components of the Bezier curve. 

> B1:= plot([bz[1][1],bz[1][2], t=0..1], scaling=constrained):
 

> B2:= plot([bz[2][1],bz[2][2],t=0..1], scaling=constrained):
 

> B3:= plot([bz[3][1], bz[3][2], t=0..1], scaling=constrained):
 

Defining the sets of controlled points to be plotted with the graph. 

> ptc:= plot({seq(c[j],j=0..3)}, style=point, symbol=box, color=blue):
 

> ptb:= plot({seq(b[k],k=0..2)},style=point, symbol=circle, color = green):
 

>
 

> display({B1,B2,B3, ptb, ptc}, axes=boxed);
 

Plot_2d
 

Adjusting the 'foot' of 7. 

> bb[0]:=b[0]: bb[1]:=[0.12,0.3]:
 

> bb[2]:=b[1]: bb[3]:=b[2]:
 

> bbz[2]:= sum(bb[k]*q[k],k=0..3):
 

> BB2:= plot([bbz[2][1], bbz[2][2], t=0..1], scaling=constrained):
 

> BB2;
 

>