Define cubic(p1,p2,p3,segs) = Prgm
  Local i,t,u,prev,pt
  0  pt
  For i,1,segs+1
    (i-1.0)/segs  t    Decimal to avoid slow exact arithetic
    (1-t)  u
    pt  prev
    u^2*p1 + 2*t*u*p2 + t^2*p3  pt
    If i>1 Then
      PxlLine floor(prev[1,1]), floor(prev[1,2]), floor(pt[1,1]), floor(pt[1,2])
    EndIf
  EndFor
EndPrgm