# # Create cubic b-spline segments in different colours. # read bspline: x := 0,1,2,3,4,5: y := 0,2,4,1,0,-1: x := x,6: y := y,1: x := x,7: y := y,0: p3 := BsplineApprox(3,[y],[x],t): plot1 := plot({p3}, 0..1, colour=BLACK): plot2 := plot({p3}, 1..2, colour=YELLOW): plot3 := plot({p3}, 2..3, colour=MAGENTA): plot4 := plot({p3}, 3..4, colour=RED): plot5 := plot({p3}, 4..5, colour=CYAN): plot6 := plot({p3}, 5..6, colour=GREEN): plot7 := plot({p3}, 6..7, colour=BLACK): plotP := plot([pairs([x],[y])],style=point, colour=WHITE): with(plots): display({plot1,plot2,plot3,plot4,plot5,plot6,plot7,plotP},title=`Cubic B-spline segments on input data`);