MIT 6.001 Fall, 1997 Instructor: A. Meyer T.A.: A Chefter Recitation #7, Problems Done in Recitation, Wed., 10/8/97 From PS3: Curve = Unit-Interval --> Point where Point was an abstraction of two Sch-Nums. Now define Curve2 to be a Scheme pair of the separate x(t) and y(t) procedures (instead of one procedure returning an abstract point): Curve2 = (Unit-Interval --> Sch-Num) X (Unit-Interval --> Sch-Num) where if C2 is a Curve2 we expect (car C2) to be the x(t) procedure and (cdr C2) to be the y(t) procedure. Exercise 1: Define a procedure CURVE->CURVE2 which given a CURVE, C, that is a Scheme procedure of type Unit-Interval --> Point, returns a Curve2, C2, which describes the same parametric planar curve, but in the Curve2 representation Exercise 2: Carefully state what is meant by the claim that (CURVE->CURVE2 C) "describes the same parametric planar curve" as C. It was briefly remarked, with a handwavy explanation at the end of recitation that (i) MATHEMATICALLY the CURVE and CURVE2 representations were "equivalent" in that one could straightforwardly convert from one to the other, (ii) COMPUTATIONALLY there was a significant difference between them: eval'ing (((repeated (rotate theta) n) curve) t) requires n evaluations of points on the curve; but eval'ing the corresponding (((repeated (rotate2 theta) n) (car curve2)) t) requires 2^n calls of the X(t) and Y(t) procedures on the n rotated Curve2's. (Here ROTATE2 is the procedure which rotates a Curve2 by a given number of radians.)