<> <> <> <> DIRECTORY Complex, Cubic, Seq; LSPiece: CEDAR DEFINITIONS = BEGIN OPEN Seq; FitPiece: PROCEDURE [z: ComplexSequence, t: RealSequence _ NIL, from, thru: NAT, -- fit points in range [from..thru] modulo z.length eps: REAL _ .00001, -- stop iterating if the sum of squares gets below this amount maxd: REAL _ .00001, --stop iterating if the maximum deviation gets below this amount maxit: NAT _ 500, -- limit on number of iterations deltat: REAL _ 0.000005, -- stop when the t values each change by less than this initFree, finalFree: BOOLEAN _ FALSE, initTangent, finalTangent: Complex.Vec _ [0,0], useOldTValues: BOOLEAN _ FALSE] RETURNS [b: Cubic.Bezier, err: REAL, iterations: NAT, maxDev: REAL]; <= maxit.>> END.