m.stone February 19, 1980 5:20 PM
Last Edited by: Stone, March 15, 1983 3:26 pm
CubicSplines: CEDAR DEFINITIONS = BEGIN
X: NAT = 1;
Y: NAT = 2;
NDIM: NAT = Y;
points in object space
FPCoords: TYPE = ARRAY [X..NDIM] OF REAL;
points in screen space
ScrPt: TYPE = ARRAY [X..NDIM] OF REAL;
Coeffs: TYPE = RECORD
[t3: FPCoords,
t2: FPCoords,
t1: FPCoords,
t0: FPCoords];
CoeffsSequence: TYPE = REF CoeffsSequenceRec;
CoeffsSequenceRec: TYPE = RECORD[element: SEQUENCE length:NAT OF Coeffs];
KnotSequence: TYPE = REF KnotSequenceRec;
KnotSequenceRec: TYPE = RECORD[element: SEQUENCE length:NAT OF FPCoords];
SplineType: TYPE =
global splines
{naturalUM,cyclicUM,naturalAL,cyclicAL,
special case cubic curves
bezier,bsplineInterp,
local splines
bspline,crspline}; 
TooFewKnots: SIGNAL[numknots: INTEGER] ;
UnknownSpline: SIGNAL[splineType: SplineType] ;
UnmatchedEnds: SIGNAL ;
NoInitSplines: SIGNAL ;
MakeSpline: PROCEDURE
[knots: KnotSequence, splineType: SplineType] RETURNS [CoeffsSequence];
DisplayCubic: PROCEDURE
[coeffs: Coeffs,
MoveTo: PROCEDURE[ScrPt],
DrawTo: PROCEDURE[ScrPt],
tol: REAL ← 0.5];
END.