Cubic2.mesa
Copyright Ó 1985, 1987, 1992 by Xerox Corporation. All rights reserved.
Eric Nickell, June 27, 1985 9:38:44 pm PDT
Stone, June 29, 1985 11:51:58 am PDT
Doug Wyatt, April 8, 1992 5:25 pm PDT
DIRECTORY
Imager USING [VEC];
Cubic2: CEDAR DEFINITIONS = {
Coeffs: TYPE = RECORD[c0,c1,c2,c3: Imager.VEC];
The coefficients for a parametric cubic
x = c3.x*t^3 + c2.x*t^2 + c1.x*t + c0.x
y = c3.y*t^3 + c2.y*t^2 + c1.y*t + c0.y
Bezier: TYPE = RECORD[b0,b1,b2,b3: Imager.VEC];
Bezier point representation for a cubic
CoeffsToBezier: PROC[Coeffs] RETURNS[Bezier];
BezierToCoeffs: PROC[Bezier] RETURNS[Coeffs];
Split: PROC[Bezier] RETURNS[Bezier,Bezier];
AlphaSplit: PROC [bezier: Bezier, alpha: REAL] RETURNS[Bezier, Bezier];
Split the bezier curve into the two pieces generated by parameter values [0..alpha] and [alpha..1], respectively.
Flat: PROC[bezier: Bezier, epsilon: REAL] RETURNS[BOOLEAN];
}.