1+1   (* To evaluate, press Shift+Enter NOT just Enter *)

f[x_]=x^2;   (* Define a function for a general input x 
Function inputs use square brackets: f[x] not f(x)
Underscore after x_ means input variable (local variable)
Semi-colon means don't display result. *)
f[3]
f[a]

norm[{a_,b_,c_}]=Sqrt[a^2+b^2+c^2]; (* Define my own norm function, not built-in Norm 
Coordinates use curly brackets not parentheses: {a,b,c} not (a,b,c) 
Built-in functions have capital letter: Sqrt not sqrt *)
norm[{x,y,z}]

(* Compute Frenet Frame u[t],n[t],b[t] for a curve c[t] *)
c[t_]={2Cos[t],2Sin[t],0};  (* Parametrized circle of radius 2 *)
cp[t_]=D[c[t],t];  (* Tangent vector = derivative with respect to t *)
u[t_]=Simplify[cp[t]/norm[cp[t]]]; (* Unit tangent, simplify trig expressions *)
up[t_]=D[u[t],t]; (* Normal acceleration *)
n[t_]=Simplify[up[t]/norm[up[t]]];  (* Unit normal *)
b[t_]=Simplify[Cross[u[t],n[t]]];  (* Binormal from cross product *)
n[t]   (* No semi-colon, so display n[t] *)
b[t]  

toroidal[t_,p_,q_]=c[t]+p n[t]+q b[t];  (* Frenet coordinate map *)
toroidal[t,p,q]

ParametricPlot3D[ toroidal[t,Cos[p],Sin[p]], {t,0, 2.25Pi},{p,0,2.25Pi}, Mesh->{8,8},Boxed->True]  (* Mesh controls number of grid curves. Boxed frames the picture *)

(* Grab and rotate the picture. Enlarge by pulling a corner. *)