INTERFACE LR2Curve; IMPORT LR3, PZTypes; FROM PZTypes IMPORT FloatChain, FourierChain; TYPE T <: Public; Public = OBJECT METHODS fMax(): CARDINAL; (* This object represents an arbitrary closed curve of the form a_0 + \sum_{ i = 1}^{ fMax} ( a_i \cos(i \theta) + b_i \sin( i \theta))$ where $a_i$ , $b_i$ are vectors of $R^2$ and $\theta$ is an argument (modulo $2\pi$). *) mMin(): CARDINAL; (* The minimum number of samples needed to avoid aliasing, i.e. $ mMin = 2 * fMax + 1 $ . *) eval(theta : LONGREAL): LR3.T; (* Evaluates the point at an arbitrary $\theta$; in $[0..2\pi]$ *) length(theta : LONGREAL): LONGREAL; (* Returns the length of the curve for argument in the range $[0..\theta]$ *) sample(theta : LONGREAL; n : CARDINAL): REF FloatChain; (* $res[k] = eval(\theta + k 2 \pi / n, order), k = 0 .. n-1 $ *) diff(order : CARDINAL) : T; (* Evaluates the "order"th derivative of the curve *) init(READONLY F : FourierChain) : T; (* evalP(p: LR3.T) : LONGREAL; Evalutes the parameter associate at an point $p$. If $p$ is not in the curve the returned parameter is NaN *) END; END LR2Curve.