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

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

ParametricPlot3D[trifoglioprb[t],{t,0,4 π}, PerformanceGoal->"Quality", PlotRange -> {{-1,1},{-1,1},{-.5,1.5}}]

esl3D[a_, b_ , c_][t_] := {a*E^(b*t)*Cos[t], a*E^(b*t)*Sin[t], c*t}

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

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

viviani[a_][t_] := a*{1+Cos[t], Sin[t], 2Sin[t/2]}

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

Manipulate[Show[ParametricPlot3D[trifoglioprb[t], {t,0, 2Pi}], Graphics3D[{PointSize[0.02], Red, Point[trifoglioprb[k]]}], Graphics3D[{Thick, Green, Arrow[{trifoglioprb[k],trifoglioprb[k]+tangente[trifoglioprb][k]/3}]}],Graphics3D[{Thick, Blue, Arrow[{trifoglioprb[k],trifoglioprb[k]+normale[trifoglioprb][k]/3}]}],Graphics3D[{Thick, Orange, Arrow[{trifoglioprb[k],trifoglioprb[k]+binormale[trifoglioprb][k]/3}]}]], {k, 0.1, 2Pi}]

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

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

curvatura[trifoglioprb][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

torsione[elica[2,3]][t]

GraphicsRow[{ParametricPlot3D[trifoglioprb[t],{t,0,2 π}], Plot[curvatura[trifoglioprb][t], {t,0, 2Pi}], Plot[torsione[trifoglioprb][t], {t,0, 2Pi}]}]

Manipulate[GraphicsRow[{Show[{ParametricPlot3D[trifoglioprb[t],{t,0,2 Pi}], Graphics3D[{PointSize[0.08],Black, Point[trifoglioprb[k]]}]}], Plot[curvatura[trifoglioprb][t], {t,0, 2Pi}, Epilog -> {PointSize[0.02], Point[{k,curvatura[trifoglioprb][k]}]}], Plot[torsione[trifoglioprb][t], {t,0, 2Pi}, Epilog -> {PointSize[0.02], Point[{k,torsione[trifoglioprb][k]}]}]}], {k, 0.1, 2Pi}]

GraphicsRow[{Show[{ParametricPlot3D[trifoglioprb[t],{t,0,2 π}], Graphics3D[{PointSize[0.02], Red, Point[trifoglioprb[2]]}]}], Plot[curvatura[trifoglioprb][t], {t,0, 2Pi}, Epilog -> {PointSize[0.02], Point[curvatura[trifoglioprb][2]]}], Plot[torsione[trifoglioprb][t], {t,0, 2Pi}, Epilog -> {PointSize[0.02], Point[torsione[trifoglioprb][2]]}]}]

Show[{ParametricPlot3D[trifoglioprb[t],{t,0,2 Pi}], Graphics3D[{PointSize[0.02], Red, Point[trifoglioprb[2]]}]}]

Plot[curvatura[trifoglioprb][t], {t,0, 2Pi}, Epilog -> {PointSize[0.02], Point[{2,curvatura[trifoglioprb][2]}]}]

ellissoide[a_,b_,c_][u_,v_] :={a*Cos[v]Cos[u],b*Cos[v]Sin[u], c*Sin[v]}

ParametricPlot3D[ellissoide[1,1,1][u,v], {u, -2Pi,2Pi}, {v, -2Pi, 2Pi}, PlotRange -> {{-4,4},{-4,4}, {-4, 4}}]

ParametricPlot3D[ellissoide[3,2,1][u,v], {u, -2Pi,2Pi}, {v, -2Pi, 2Pi}, PlotRange -> {{-4,4},{-4,4}, {-4, 4}}]

ParametricPlot3D[ellissoide[3,2,1][u,v], {u, -2Pi,2Pi}, {v, -2Pi, 2Pi}, PlotRange -> {{-4,4},{-4,4}, {-4, 4}}, Boxed -> False, Axes -> False, Mesh -> None, PlotStyle->Directive[Blue, Specularity[White, 10]]]

ParametricPlot3D[ellissoide[3,2,1][u,v], {u, -2Pi,2Pi}, {v, -2Pi, 2Pi}, PlotRange -> {{-4,4},{-4,4}, {-4, 4}}, Boxed -> False, Axes -> False, Mesh -> None, PlotStyle->Directive[Blue, Specularity[White, 10]]]

ParametricPlot3D[ellissoide[3,2,1][u,v], {u, -2Pi,2Pi}, {v, -2Pi, 2Pi}, PlotRange -> {{-4,4},{-4,4}, {-4, 4}}, Boxed -> False, Axes -> False, Mesh -> None, PlotStyle->Opacity[.5]]

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

ParametricPlot3D[torov[3,6][u,v], {u, -2Pi, 2Pi}, {v, -2Pi, 2Pi}]

ContourPlot3D[x^4+y^4+z^4-(x^2+y^2+z^2)^2+3(x^2+y^2+z^2)==3, {x,-2,2}, {y, -2,2}, {z,-2,2}]

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

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

vn[x_][u_,v_] :=Module[{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}];];

vn[ellissoide[1,1,1]][u,v]

Show[{ParametricPlot3D[ellissoide[1,1,1][u,v], {u, -2Pi,2Pi}, {v, -2Pi, 2Pi}, PlotRange -> {{-2,2},{-2,2}, {-2, 2}}], Graphics3D[Arrow[{ellissoide[1,1,1][1,1], ellissoide[1,1,1][1,1]+vn[ellissoide[1,1,1]][1,1]}]]}]