(* This notebook draws a spiral on top of the graph of y=(x^2). *)

(* The Nest command can be used to iterate a function. *)
Nest[Sin,1,5]

(* The Table command makes lists of numbers *)
squares=Table[n^2,{n,1,20}]
cubes=Table[n^3,{n,1,20}]

(* We can use Riffle to alternate elements from two lists. *)
Riffle[squares,cubes]

(* Table can also be used to make lists of points *)
Table[{n,n^2},{n,1,20}]

(* The Line and Graphics commands can draw line segments from a list of points *)
spiralpoints=Table[{0.05*n*Cos[n*Pi/4],0.05*n*Sin[n*Pi/4]},{n,1,16}]
spiral=Graphics[Line[spiralpoints]]

(* We can use Show to superimpose this spiral with a Plot. *)
Show[ Plot[x^3,{x,-1,1},AspectRatio->Automatic], spiral ]