Tangent and normal vectors for curves

(* find the magnitude of a vector *)
magnitude[vec_] := Simplify[Sqrt[vec.vec]]

A line in R^2

f[t_]=t{1,2}+(1-t){-1,0}

A circle (of radius 2, centered at (1,1))

f[t_]=2{Cos[t],Sin[t]}+{1,1}

A cusp curve

f[t_]={t^2,t^3}

A Helix

f[t_]={Sin[t],Cos[t],t/4}

A cusp curve in space

f[t_]={t^2,t^3,t^4}

3 D Spirograph

f[t_]=3*Sin[13t]{1,0,0}+5*Cos[11t]{0,1,0}+4*Sin[9t]{0,0,1}

Ellipse (9 x^2 + 4 y^2 = 36)

f[t_]={2 Sin[t],3 Cos[t]}

The linear approximation of a curve f[t] at a; the velocity, unit tanget vector, curvature, and (primary) unit normal vector at t; a parametrization of the `osculating plane’ at f[a]

L[a_,t_]:=Simplify[f[a]+f'[a](t-a)]
velocity[t_]:=magnitude[f'[t]]
utangent[t_] := Simplify[f'[t]/velocity[t]]
curvature[t_] :=magnitude[utangent'[t]]
unormal[t_] := Simplify[utangent'[t]/curvature[t]]
P[a_,s_,t_] := f[a]+s utangent[a]+t unormal[a]

A curve in the plane

a=Pi/4;
f[a]
(* the curve *)
p1=ParametricPlot[f[t],{t,0,2Pi}];
(* the point f[a] *)
p2=Graphics[{PointSize->.03,Point[f[a]]}];
(* the tangent line through f[a] *)
p3=ParametricPlot[L[a,t],{t,a-.5,a+.5}];
(* the unit tangent vector at f[a] *)
p4=Graphics[Arrow[{f[a],utangent[a]+f[a]}]];
(* the unit normal vector at f[a] *)
p5=Graphics[Arrow[{f[a],unormal[a]+f[a]}]];
(* Show whichever of the above objects that you want to *)
Show[p1,p2,p4,p5,PlotRange->{{-4,4},{-4,4}}]

A curve in space

a=1;
f[a]
p1=ParametricPlot3D[f[t],{t,-10,10}];
p2=Graphics3D[{PointSize->.03,Point[f[a]]}];
p3=ParametricPlot3D[L[a,t],{t,a-1,a+1}];
p4=Graphics3D[Arrow[{f[a],utangent[a]+f[a]}]];
p5=Graphics3D[Arrow[{f[a],unormal[a]+f[a]}]];
p6=ParametricPlot3D[P[a,s,t],{s,-1,1},{t,-1,1}];
Show[p1,p2,p3,PlotRange->{{-2,2},{-2,2},{-2,2}}]

curvature[t]

f[t]