(program (define CIRCLE (T) {vector[2*cos(T), 2*sin(T)] } )  2, CIRCLE, 1, 1,  0, 1, 0,  , retval,  , 2 ; 0, 0, 0,  , T,  , 0 ; CIRCLE(T); [2*COS(T), 2*SIN(T)]  | 
 (define ID (T) {vector[T,T] } )  2, ID, 1, 1,  0, 1, 0,  , retval,  , 2 ; 0, 0, 0,  , T,  , 0 ; ID(T); [T,T]  | 
 ((lambda (!x) (set !x !x)) 'CX)  3 , CX ; 
 ((lambda (!x) (set !x !x)) 'CY)  3 , CY ; 
 (define FN (X Y) {vector[X^2 - Y^2 + CX, 2*X*Y+ CY] } )  2, FN, 2, 1,  0, 1, 0,  , retval,  , 2 ; 0, 0, 0,  , X,  , 0 ; 0, 0, 0,  , Y,  , 0 ; FN(X, Y); [X^2 -Y^2 +CX, 2*X*Y+CY]  | 
 (define ROUND (X) {.0001* trunc(.5+ X*10000) } )  2, ROUND, 1, 1,  0, 0, 0,  , retval,  , 0 ; 0, 0, 0,  , X,  , 0 ; ROUND(X); .0001* TRUNCATE(.5+X*10000)  | 
 (define ITERATE (FIRST REPS) (program (select "Complex Plane")

 (make CX {FIRST(1) } ) 
 (make CY {FIRST(2) } ) 
 (point (eval FIRST))

 (loop (D {0 } N {0 } X {0 } Y {0 } ) (UNTIL {or(D>4,N>REPS) } ) (do (program (make NP {FN(X,Y)  } ) 
 (make X {NP(1) } ) 
 (make Y {NP(2) } ) 
 (make D {X^2+ Y^2 } ) 
 (make N {N+ 1 } ) 
 (move (eval {vector[X, Y]}))

 )) (result {N }))
 ))  2, ITERATE, 2, 2,  0, 9, 0,  , retval,  , 0 ; 0, 1, 0,  , FIRST,  , 2 ; 0, 0, 0,  , REPS,  , 0 ; ITERATE(FIRST,REPS) ; PROGRAM ITERATE (VECTOR #2 FIRST) (EXPRESSION REPS)
 {SELECT "Complex Plane";
   LET CX  FIRST(1);
   LET CY  FIRST(2);
   POINT FIRST;
    DO 
     D = 0
     N = 0
     X = 0
     Y = 0
    UNTIL  OR(D>4,N>REPS)
    RETURNING N
    { LET NP BE FN(X,Y) ;
      LET X BE NP(1); 
      LET Y BE NP(2);
      LET D BE X^2+Y^2;
      LET N BE N+1;
      MOVE [X, Y];
    } 
 } |
 (define ITERPOINT (FIRST REPS) (program (select "Complex Plane")

 (make CX {FIRST(1) } ) 
 (make CY {FIRST(2) } ) 
 (point (eval FIRST))

 (loop (D {0 } N {0 } X {0 } Y {0 } ) (UNTIL {or(D>4,N>REPS) } ) (do (program (make NP {FN(X,Y)  } ) 
 (make X {NP(1) } ) 
 (make Y {NP(2) } ) 
 (make D {X^2+ Y^2 } ) 
 (make N {N+ 1 } ) 
 (pendown)

 (point (eval {vector[X, Y]}))

 (penup)

 )) (result {N }))
 ))  2, ITERPOINT, 2, 2,  0, 9, 0,  , retval,  , 0 ; 0, 1, 0,  , FIRST,  , 2 ; 0, 0, 0,  , REPS,  , 0 ; ITERPOINT(FIRST,REPS) ; PROGRAM ITERPOINT (VECTOR #2 FIRST) (EXPRESSION REPS)
 {SELECT "Complex Plane";
   LET CX BE FIRST(1);
   LET CY BE FIRST(2);
   POINT FIRST;
    DO 
     D = 0
     N = 0
     X = 0
     Y = 0
    UNTIL  OR(D>4,N>REPS)
     RETURNING N
   {  LET NP BE FN(X,Y) ;
      LET X BE NP(1); 
      LET Y BE NP(2);
      LET D BE X^2+Y^2;
      LET N BE N+1;
      PENDOWN;     
      POINT [X, Y];
      PENUP; 
     } 
      
 } |
 (define ITERLEG (CVAL) (program (readfloat)

 (select "Time Series")

 (penup)

 (move (eval {vector[0,1]}))

 (pendown)

 (loop (I {2 } ) (UNTIL {I =  21 } ) (do (program (setc XN I {XN(I- 1)^2+ CVAL } ) 
 (setentry {I} {2} (eval {XN(I)}))

 (move (eval {vector[XN(I),I]}))

 (make I {I+ 1 } ) 
 )) (result {CVAL }))
  (updatedata 2)

 (readlong)

 ))  2, ITERLEG, 1, 2,  0, 9, 0,  , retval,  , 0 ; 0, 0, 0,  , CVAL,  , 0 ; ITERLEG(CVAL) ; PROGRAM ITERLEG (EXPRESSION CVAL) 
  {READFLOAT;
   SELECT "Time Series";
   
   PENUP;
   MOVE [0,1];
   PENDOWN; 
     DO 
       I = 2
       UNTIL  I == 21
       RETURNING CVAL
     { 
       LET XN(I) BE XN(I-1)^2+CVAL;
       ENTRY I 2 XN(I);
       MOVE [XN(I),I];
       LET I BE I+1;
      }
   UPDATETABLE 2;
   READLONG;
} |
 )