from visual import * p0 = [0,0] p1 = [10,0] v0 = [0,20] v1 = [0,-10] def A(t): return (t-1)**2*(2*t+1) def B(t): return -t**2*(2*t-3) def C(t): return t*(1-t)**2 def D(t): return t**2*(t-1) def Hermite(p0,p1,v0,v1): points(pos = [p0, p1]) arrow(pos=p0, axis=v0, shaftwidth=0.01) arrow(pos=p1, axis=v1, shaftwidth=0.01) t = arange(0,1.01, 0.01) At, Bt, Ct, Dt = A(t), B(t), C(t), D(t) curve(x = At*p0[0]+Bt*p1[0]+Ct*v0[0]+Dt*v1[0],y = At*p0[1]+Bt*p1[1]+Ct*v0[1]+Dt*v1[1],radius = 0.1, color=color.red) Hermite(p0,p1,v0,v1)