(*  cot_values.nb *)
(* *)
(*  Purpose: *)
(*    Evaluate the cotangent *)
(*    function at selected argument values, *)
(*    and write the data to a file. *)
(* *)
(*  Modified:  16 March 2010 *)
(*  Author:  John Burkardt *)

xvec = { 1/12, Pi/12, 6/12, 2 Pi/12, 3 Pi/12, 
12/12,4 Pi/12, 5 Pi/12,  6 Pi / 12, 11Pi/24,23Pi/48, 2, 3,  4, 5 };
fvec = {};
num = Length [ xvec ];

Do [ { x = xvec[[i]], f = Cot[x] ,
fvec = Append [ fvec, f ],
      Print["  Cot[",x,"]=",N[f,20]] },{i,1,num,1}]

fileout=OpenWrite["/Users/burkardt/public_html/math_src/test_values/cot_values.txt"];
SetOptions[fileout,FormatType->TextForm];
Write[fileout,"#  cot_values.txt"];today=DateList[];Write[fileout,"#  Created on ",today];Write[fileout,"#"];
Write[fileout,"#  x  f"];
Write[fileout,"#"];
Do[{x=xvec[[i]];f=fvec[[i]];Write[fileout,N[x,20],"  ",N[f,20]]},{i,1,num,1}];Close[fileout];