tangente[gamma_][t_] :=Simplify[D[gamma[tt], tt]/(D[gamma[tt], tt].D[gamma[tt], tt])^(1/2)] /. tt->t

binormale[gamma_][t_] :=Simplify[Cross[D[gamma[tt], tt], D[gamma[tt], {tt,2}]]/(Cross[D[gamma[tt], tt], D[gamma[tt], {tt,2}]].Cross[D[gamma[tt], tt], D[gamma[tt], {tt,2}]])^(1/2)]/. tt -> t

normale[gamma_][t_] := Simplify[Cross[binormale[gamma][tt], tangente[gamma][tt]]] /. tt -> t

frenet[gamma_][m_]:=Manipulate[Show[ParametricPlot3D[gamma[t], {t,0,m},PlotRange->m+2], Graphics3D[{PointSize[0.02], Red, Point[gamma[k]]}], Graphics3D[{Thick, Green, Arrow[{gamma[k],gamma[k]+tangente[gamma][k]}]}],Graphics3D[{Thick, Blue, Arrow[{gamma[k],gamma[k]+normale[gamma][k]}]}],Graphics3D[{Thick, Orange, Arrow[{gamma[k],gamma[k]+binormale[gamma][k]}]}]], {k, 0.1,m}]

cubic1[t_] := {3t-t^3, 3t^2, 3t+t^3}

trifoglioprb[t_] := {Cos[3t]Cos[t], Cos[3t]Sin[t], Cos[3t]^2}

elica[a_, b_][t_] := {a*Cos[t], a*Sin[t],b*t}

twistedcubic[t_] := {t, t^2, t^3}

torsione[gamma_][t_] := Simplify[Cross[D[gamma[tt], tt],D[gamma[tt], {tt,2}]].D[gamma[tt], {tt,3}]/(Cross[D[gamma[tt], tt],D[gamma[tt], {tt,2}]].Cross[D[gamma[tt], tt],D[gamma[tt], {tt,2}]])] /. tt -> t

curvatura[gamma_][t_] :=Simplify[(Cross[D[gamma[tt], tt], D[gamma[tt], {tt,2}]].Cross[D[gamma[tt], tt], D[gamma[tt], {tt,2}]])^(1/2)/(D[gamma[tt], tt].D[gamma[tt], tt])^(3/2)]/. tt-> t

torsione[gamma_][t_] := Simplify[Cross[D[gamma[tt], tt],D[gamma[tt], {tt,2}]].D[gamma[tt], {tt,3}]/(Cross[D[gamma[tt], tt],D[gamma[tt], {tt,2}]].Cross[D[gamma[tt], tt],D[gamma[tt], {tt,2}]])] /. tt -> t

curvatura[trifoglioprb][t]

GraphicsRow[{ParametricPlot3D[trifoglioprb[t], {t,0,2Pi}], Plot[curvatura[trifoglioprb][t], {t, 0,2Pi}, PlotLabel -> "curvatura"]}]

Manipulate[GraphicsRow[{Show[ParametricPlot3D[trifoglioprb[t], {t,0,2Pi}], Graphics3D[{PointSize[0.05], Red, Point[trifoglioprb[k]]}]], Plot[curvatura[trifoglioprb][t], {t, 0,2Pi}, PlotLabel -> "curvatura", Epilog -> Point[{k,curvatura[trifoglioprb][k]}]]}], {{k, 0.1},0.01, 2Pi}]

selladiscimmia[u_,v_]:={u,v,u^3-3u*v^2}

paraboloideiperbolico[u_,v_]:={u,v,u*v}

ParametricPlot3D[{(1+v/2*Cos[1/2*u])*Cos[u],(1+v/2*Cos[1/2*u])*Sin[u],v/2*Sin[u/2]},{u,0,2*Pi},{v,-1,1}]

ParametricPlot3D[{(1+v/2*Cos[1/2*u])*Cos[u],(1+v/2*Cos[1/2*u])*Sin[u],v/2*Sin[u/2]},{u,0,2*Pi},{v,-1,1}, Mesh->None, BoxRatios->{1,1,1}, Boxed -> False, Axes -> False]

toro[u_, v_]:={Cos[u] (2+Cos[v]),Sin[u] (3+Cos[v]),Sin[v]}

toretto[a_,b_][u_,v_] :={Cos[u]*(a+Cos[v]), Sin[u]*(b+Cos[v]), Sin[v]}

ParametricPlot3D[paraboloideiperbolico[u,v], {u,-1,1},{v,-1,1}, Mesh -> None, PlotStyle -> {RGBColor[0.79,0.62,0.2], Opacity[.4]}]

ContourPlot3D[x^2+y^4== z^4, {x,-10, 10}, {y, -10, 10}, {z, -4, 4}]

ParametricPlot3D[selladiscimmia[u,v],{u,-1,1}, {v,-1,1}]

pt[x_][u0_,v0_][u_,v_]:=x[u0,v0]+D[x[uu0,vv0],uu0]*u+D[x[uu0,vv0],vv0]*v /. {uu0->u0,vv0->v0}

pianotangente[sigma_][u0_,v0_][u_,v_] := sigma[u0,v0]+D[sigma[uu,vv], uu]*u+D[sigma[uu,vv],vv]*v /. {uu-> u0,vv-> v0}

unitnormal[x_][u_,v_]:=Block[{xu,xv,N1},
xu=D[x[uu,vv],uu];
xv=D[x[uu,vv],vv];
N1=Cross[xu,xv];
Return[Simplify[N1.N1]^(-1/2)*N1 /. {uu->u,vv->v}];
]

Show[{
ParametricPlot3D[sfera[u,v],{u,0,Pi},{v,-Pi,Pi}],
ParametricPlot3D[pianotangente[sfera][Pi/7,-Pi/4][u,v],{u,-.4,.4},{v,-.4,.4},Mesh->None]
}]

Show[{ParametricPlot3D[toretto[u,v], {u, 0, 2Pi}, {v, 0, 2Pi}, PlotStyle -> Opacity[.3]],
ParametricPlot3D[pianotangente[toretto][Pi,Pi][u,v],{u,-.8,.8},{v,-.8,.8},Mesh->None]
}]

pianotangente[toro][1,2][u,v]

pt[toro][1,2][u,v]

sfera[u_, v_] := {Sin[u]Cos[v],Sin[u]Sin[v], Cos[u]}

Show[{
ParametricPlot3D[sfera[u,v],{u,0,Pi},{v,-Pi,Pi},PlotStyle -> {RGBColor[0.5,0.63,0.5], Opacity[.4]}],
ParametricPlot3D[pianotangente[sfera][Pi/7,-Pi/4][u,v],{u,-.4,.4},{v,-.4,.4},Mesh->None]
}]