circle[{a_,b_},r_][t_]:={a,b}+r*{Cos[t],Sin[t]}

ellisse[{a_,b_},{rx_,ry_}][t_]:={a,b}+{rx*Cos[t],ry*Sin[t]}

otto[t_]:={Sin[t],Sin[t]*Cos[t]}

trifoglio[t_ ]:={Cos[3t]Cos[t],Cos[3t]Sin[t]}

spir[a_][t_]:=a*t*{Cos[t],Sin[t]}

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

circle3d[{a_,b_},r_][t_]:={a,b,0}+r*{Cos[t],Sin[t],0}

otto3d[t_]:={Sin[t],Sin[t]*Cos[t],0}

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

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

inscurve[n_,a_,gamma_][t_]:=Insert[gamma[t],a,n]

rt[a_]:={{Cos[a],-Sin[a]},{Sin[a],Cos[a]}}

rfl[m_]:=1/(1+m^2){{1-m^2,2m},{2m,m^2-1}}

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

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

tubo[gamma_][r_][t_,teta_]:=gamma[t]+r(-Cos[teta]*normal[gamma][t]+Sin[teta]*binormal[gamma][t])

seashell[gamma_][r_][t_,teta_]:=gamma[t]+r*t*(-Cos[teta]*normal[gamma][t]+Sin[teta]*binormal[gamma][t])

tangent[gamma_][t_]:=
Simplify[D[gamma[tt],tt]/(D[gamma[tt],tt].D[gamma[tt],tt])^(1/2)]/. tt->t
binormal[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
normal[gamma_][t_]:=Simplify[Cross[binormal[gamma][tt],tangent[gamma][tt]]]/. 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

caratt[gamma_][t_]:={tangent[gamma][t],normal[gamma][t],binormal[gamma][t],curvatura[gamma][t],torsione[gamma][t]}

grafct[gamma_]:=Manipulate[GraphicsRow[{Show[{ParametricPlot3D[gamma[t],{t,0,2Pi},Axes->None],Graphics3D[Point[gamma[k]]]}],Plot[curvatura[gamma][t]//Evaluate,{t,0,2Pi},PlotLabel->"Curvatura",Epilog->Point[{k,curvatura[gamma][t]/.t->k}]],Plot[torsione[gamma][t]//Evaluate,{t,0,2Pi},PlotLabel->"Torsione",Epilog->Point[{k,torsione[gamma][t]/.t->k}]]}],{k,0.001,2Pi}]

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

(* sfera unitaria: {Cos[v]Cos[u],Cos[v]Sin[u],Sin[v]}  *)
(* "paralleli": v=cost    "meridiani": u=cost   *)

(* "parallelo": v=0 (equatore) *)

{Cos[0]Cos[u],Cos[0]Sin[u],Sin[0]}

{Cos[v]Cos[u],Cos[v]Sin[u],Sin[v]}/.v->0

Table[{Cos[v]Cos[u],Cos[v]Sin[u],Sin[v]},{v,0,Pi/2,Pi/8}]

{Cos[v]Cos[u],Cos[v]Sin[u],Sin[v]}/.v->u

{Cos[v]Cos[u],Cos[v]Sin[u],Sin[v]}/.{u->0,v->0}

Show[{ParametricPlot3D[{Cos[v]Cos[u],Cos[v]Sin[u],Sin[v]},{u,0,2Pi},{v,0,Pi/2},Mesh->None,PlotStyle->Opacity[0.5]],ParametricPlot3D[Table[{Cos[v]Cos[u],Cos[v]Sin[u],Sin[v]}/.u->2k*Pi/24,{k,0,23}],{v,0,3Pi/8},PlotStyle->{Red,Thick}],ParametricPlot3D[Table[{Cos[v]Cos[u],Cos[v]Sin[u],Sin[v]}/.v->2k*Pi/16,{k,0,6}],{u,0,2Pi},PlotStyle->{Red,Thick}]},ImageSize->200,AspectRatio->Automatic]

Show[{ParametricPlot3D[{Cos[v]Cos[u],Cos[v]Sin[u],Sin[v]},{u,0,2Pi},{v,0,5Pi/12},Mesh->None,PlotStyle->Opacity[0.5]],ParametricPlot3D[Table[{Cos[v]Cos[u],Cos[v]Sin[u],Sin[v]}/.u->2k*Pi/24,{k,0,23}],{v,0,5Pi/12},PlotStyle->{Red,Thick}],ParametricPlot3D[Table[{Cos[v]Cos[u],Cos[v]Sin[u],Sin[v]}/.v->2k*Pi/24,{k,0,6}],{u,0,2Pi},PlotStyle->{Red,Thick}]},ImageSize->400,AspectRatio->Automatic]

Manipulate[Show[{ParametricPlot3D[{Cos[v]Cos[u],Cos[v]Sin[u],Sin[v]},{u,0,2Pi},{v,0,5Pi/12},Mesh->None,PlotStyle->Opacity[0.5]],ParametricPlot3D[Table[{Cos[v]Cos[u],Cos[v]Sin[u],Sin[v]}/.u->2k*Pi/24,{k,0,23}],{v,0,5Pi/12},PlotStyle->{Red,Thick}],ParametricPlot3D[Table[{Cos[v]Cos[u],Cos[v]Sin[u],Sin[v]}/.v->2k*Pi/24*a^k,{k,0,6}],{u,0,2Pi},PlotStyle->{Red,Thick}]},ImageSize->400,AspectRatio->Automatic],{{a,.985},0.001,2,.001}]

Show[{ParametricPlot3D[{Cos[v]Cos[u],Cos[v]Sin[u],Sin[v]},{u,0,2Pi},{v,-Pi/2,Pi/2},Mesh->None],ParametricPlot3D[{Cos[v]Cos[u],Cos[v]Sin[u],Sin[v]}/.v->Sqrt[2]u,{u,0,32Pi},PlotStyle->{Red,Thick}]},ImageSize->200]

Show[{ParametricPlot3D[{Cos[v]Cos[u],Cos[v]Sin[u],Sin[v]},{u,0,2Pi},{v,-Pi/2,Pi/2},Mesh->None],
ParametricPlot3D[{Cos[v]Cos[u],Cos[v]Sin[u],Sin[v]}/.v->5Pi/16,{u,0,2Pi},PlotStyle->{Red,Thick}],ParametricPlot3D[{Cos[v]Cos[u],Cos[v]Sin[u],Sin[v]}/.v->3Pi/16,{u,0,2Pi},PlotStyle->{Red,Thick}],ParametricPlot3D[{Cos[v]Cos[u],Cos[v]Sin[u],Sin[v]}/.v->Pi/16(Sin[8u]+4),{u,0,2Pi},PlotStyle->{Blue,Thick}]},ImageSize->200]

Show[{ParametricPlot3D[{Cos[v]Cos[u],Cos[v]Sin[u],Sin[v]},{u,0,2Pi},{v,-Pi/2,Pi/2},Mesh->None],ParametricPlot3D[{Cos[v]Cos[u],Cos[v]Sin[u],Sin[v]}/.v->Pi/8,{u,0,2Pi},PlotStyle->{Red,Thick}],ParametricPlot3D[{Cos[v]Cos[u],Cos[v]Sin[u],Sin[v]}/.v->-Pi/8,{u,0,2Pi},PlotStyle->{Red,Thick}],
ParametricPlot3D[{Cos[v]Cos[u],Cos[v]Sin[u],Sin[v]}/.v->5Pi/16,{u,0,2Pi},PlotStyle->{Red,Thick}],ParametricPlot3D[{Cos[v]Cos[u],Cos[v]Sin[u],Sin[v]}/.v->3Pi/16,{u,0,2Pi},PlotStyle->{Red,Thick}],ParametricPlot3D[{Cos[v]Cos[u],Cos[v]Sin[u],Sin[v]}/.v->Pi/8Sin[8u],{u,0,2Pi},PlotStyle->{Blue,Thick}],ParametricPlot3D[{Cos[v]Cos[u],Cos[v]Sin[u],Sin[v]}/.v->Pi/16(Sin[8u]+4),{u,0,2Pi},PlotStyle->{Blue,Thick}]},ImageSize->200]

Show[{ParametricPlot3D[{Cos[v]Cos[u],Cos[v]Sin[u],Sin[v]},{u,0,2Pi},{v,-Pi/2,Pi/2},Mesh->None],ParametricPlot3D[{Cos[v]Cos[u],Cos[v]Sin[u],Sin[v]}/.v->3u,{u,0,2Pi},PlotStyle->{Red,Thick}]},ImageSize->200]

ParametricPlot3D[{Cos[u]Cos[v],Sin[u]Cos[v],Sin[v]},{u,-6Pi,5Pi},{v,-Pi/2,Pi/2},RegionFunction->Function[{x,y,z,u,v},.1u<v<.1u+.1Pi],PlotPoints->30,PlotRange->{{-2,2},{-2,2},{-2,2}},Mesh->None,Boxed->False,Axes->None]

ParametricPlot3D[{(Cos[u])Cos[v],(Sin[u])Cos[v],Sin[v]}/. v->.1u+.1Pi,{u,-6Pi,4Pi},PlotStyle->{Thick,Red}]

Show[{ParametricPlot3D[{Cos[u]Cos[v],Sin[u]Cos[v],Sin[v]},{u,-6Pi,5Pi},{v,-Pi/2,Pi/2},RegionFunction->Function[{x,y,z,u,v},.1u<v<.1u+.1Pi],PlotPoints->30,PlotRange->{{-2,2},{-2,2},{-2,2}},Mesh->None,Boxed->False,Axes->None],
ParametricPlot3D[{(Cos[u])Cos[v],(Sin[u])Cos[v],Sin[v]}/. v->.1u+.1Pi,{u,-6Pi,4Pi},PlotStyle->{Thick,Red}],ParametricPlot3D[{(Cos[u])Cos[v],(Sin[u])Cos[v],Sin[v]}/. v->.1u,{u,-5Pi,5Pi},PlotStyle->{Thick,Green}]
}]

Show[{ParametricPlot3D[{Cos[v]Cos[u],Cos[v]Sin[u],Sin[v]},{u,0,2Pi},{v,-Pi/2,Pi/2},Mesh->None],ParametricPlot3D[{Cos[v]Cos[u],Cos[v]Sin[u],Sin[v]}/.v->u,{u,0,2Pi},PlotStyle->{Red,Thick}]},ImageSize->200]

Show[{ParametricPlot3D[{Cos[v]Cos[u],Cos[v]Sin[u],Sin[v]},{u,0,2Pi},{v,0,Pi/2},Mesh->None],ParametricPlot3D[{Cos[v]Cos[u],Cos[v]Sin[u],Sin[v]}/.v->u,{u,0,2Pi},PlotStyle->{Red,Thick}]},ImageSize->200]

Show[{ParametricPlot3D[{2Cos[v]Cos[u],Cos[v]Sin[u],Sin[v]},{u,0,2Pi},{v,0,Pi/2},Mesh->None],ParametricPlot3D[Table[{2Cos[v]Cos[u],Cos[v]Sin[u],Sin[v]},{v,0,Pi/2,Pi/8}],{u,0,2Pi},PlotStyle->{Red,Thick}],ParametricPlot3D[Table[{2Cos[v]Cos[u],Cos[v]Sin[u],Sin[v]},{u,0,2Pi,Pi/8}],{v,0,Pi/2},PlotStyle->{Red,Thick}]},ImageSize->400]

Show[{ParametricPlot3D[{Cos[v]Cos[u],Cos[v]Sin[u],Sin[v]},{u,0,2Pi},{v,0,Pi/2},Mesh->None],ParametricPlot3D[Table[{Cos[v]Cos[u],Cos[v]Sin[u],Sin[v]},{v,0,Pi/2,Pi/8}],{u,0,2Pi},PlotStyle->{Red,Thick}],ParametricPlot3D[Table[{Cos[v]Cos[u],Cos[v]Sin[u],Sin[v]},{u,0,2Pi,Pi/8}],{v,0,Pi/2},PlotStyle->{Red,Thick}]},ImageSize->200]

Show[{ParametricPlot3D[{Cos[v]Cos[u],Cos[v]Sin[u],Sin[v]},{u,0,2Pi},{v,0,Pi/2},Mesh->None],ParametricPlot3D[Table[{Cos[v]Cos[u],Cos[v]Sin[u],Sin[v]},{v,0,Pi/2,Pi/8}],{u,0,2Pi},PlotStyle->{Red,Thick}]},ImageSize->200]

Show[{ParametricPlot3D[{Cos[v]Cos[u],Cos[v]Sin[u],Sin[v]},{u,0,2Pi},{v,0,Pi/2},Mesh->None],ParametricPlot3D[{Cos[v]Cos[u],Cos[v]Sin[u],Sin[v]}/.v->0,{u,0,2Pi},PlotStyle->{Red,Thick}]},ImageSize->200]

ParametricPlot3D[{Cos[v]Cos[u],Cos[v]Sin[u],Sin[v]}/.v->0,{u,0,2Pi},ImageSize->200,Mesh->None]

ParametricPlot3D[{Cos[v]Cos[u],Cos[v]Sin[u],Sin[v]},{u,0,2Pi},{v,0,Pi/2},ImageSize->200,Mesh->None]

ParametricPlot3D[{2Cos[v]Cos[u],Cos[v]Sin[u],Sin[v]},{u,0,2Pi},{v,0,Pi/2},ImageSize->200,Mesh->None]

ParametricPlot3D[{Cos[v]^2Cos[u],Cos[v]Sin[u],Sin[v]},{u,0,2Pi},{v,0,Pi/2},ImageSize->200,Mesh->None]

ParametricPlot3D[sfera1[u,v],{u,0,2Pi},{v,0,Pi/2},ImageSize->200,Mesh->None,PlotRange->{{-10,10},{-10,10},{-10,2}}]

ParametricPlot3D[sfera1[u,v],{u,0,2Pi},{v,0,Pi/2},ImageSize->200,Mesh->None]

ParametricPlot3D[sfera1[u,v],{u,0,2Pi},{v,-Pi/2,Pi/2},ImageSize->200,Mesh->None]

p1={1,3}

g1=ParametricPlot3D[Evaluate[elicoide[1,1/2][u,v]],{u,-Pi/2,2Pi},{v,0,1}]

?elica

g2=ParametricPlot3D[Style[elica[1,1/2][t],{RGBColor[1,0,0],AbsoluteThickness[2]}],{t,-Pi/2,2Pi}]

elica[1,1/2][k]+normal[elica[1,1/2]][k]

normal[elica[1,1/2]][t]

g3=Show[ParametricPlot3D[elica[1,1/2][t],{t,-Pi/2,2Pi},PlotStyle->{Red,Thick}],Table[ParametricPlot3D[elica[1,1/2][k]+s*normal[elica[1,1/2]][k],{s,0,1}],{k,-Pi/2,2Pi,Pi/16}]]

g3=Show[ParametricPlot3D[elica[1,1/2][t],{t,-Pi/2,2Pi},PlotStyle->{Red,Thick}],Table[ParametricPlot3D[elica[1,1/2][k]+s*binormal[elica[1,1/2]][k],{s,0,1}],{k,-Pi/2,2Pi,Pi/16}]]

Show[ParametricPlot3D[elica[1,1/2][t],{t,-Pi/2,2Pi},PlotStyle->{Red,Thick}],Table[ParametricPlot3D[{elica[1,1/2][k]+s*tangent[elica[1,1/2]][k],elica[1,1/2][k]+s*normal[elica[1,1/2]][k],elica[1,1/2][k]+s*binormal[elica[1,1/2]][k]},{s,0,.3},PlotStyle->Thick],{k,-Pi/2,2Pi,Pi/16}]]

Show[GraphicsRow[{Show[g1,g2,DisplayFunction->Identity],g2,g3}],ImageSize->800]

ottocos[t_]:=inscurve[3,Cos[t],otto][t]

ParametricPlot3D[ottocos[t]*(1-s),{t,0,2Pi},{s,0,1/2}]

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

caratt[curva1][t]//PowerExpand//Factor

trifoglio[t_ ]:={Cos[3t]Cos[t],Cos[3t]Sin[t]}

ParametricPlot[trifoglio[t],{t,0,Pi}]

trifoglioprb[t]

Manipulate[Show[
ParametricPlot3D[trifoglioprb[t],{t,0,2Pi}],
Graphics3D[{PointSize[0.03],Red,Point[trifoglioprb[k]]}],
Graphics3D[{Thick,Green,Line[{trifoglioprb[k],trifoglioprb[k]+tangent[trifoglioprb][k]/5}]}],
Graphics3D[{Thick,Blue,Line[{trifoglioprb[k],trifoglioprb[k]+normal[trifoglioprb][k]/5}]}],
Graphics3D[{Thick,Red,Line[{trifoglioprb[k],trifoglioprb[k]+binormal[trifoglioprb][k]/5}]}]
],{k,0,2Pi}]

?trifoglioprb

ParametricPlot3D[tubo[trifoglioprb][.2][t,teta],{t,0,Pi},{teta,0,2Pi}]

ntf[t_]=normal[trifoglioprb][t]

bntf[t_]=binormal[trifoglioprb][t]

ParametricPlot3D[trifoglioprb[t]+.1(-Cos[teta]*ntf[t]+Sin[teta]*bntf[t]),{t,0,Pi},{teta,0,2Pi},Mesh->None,PlotPoints->50]

tubo[gamma_][r_][t_,teta_]:=gamma[t]+r(-Cos[teta]*normal[gamma][t]+Sin[teta]*binormal[gamma][t])

seashell[gamma_][r_][t_,teta_]:=gamma[t]+r*t*(-Cos[teta]*normal[gamma][t]+Sin[teta]*binormal[gamma][t])

ParametricPlot3D[Style[elica[1,1/2][t],{RGBColor[1,0,0],AbsoluteThickness[2]}],{t,-Pi/2,2Pi},Epilog->Point[{0,0,0}]]

ParametricPlot3D[tubo[elica[1,1/4]][1/2][t,teta],{t,0,6Pi},{teta,-Pi/2,3Pi/2}]

ParametricPlot3D[tubo[inscurve[3,0,circle[{0,0},1]]][1/4][t,teta],{t,-Pi/2,2Pi},{teta,-Pi/2,Pi/2}]

ParametricPlot3D[seashell[elica[1,0.6]][0.1][t,teta],{t,Pi/4,5Pi},{teta,0,2Pi},PlotPoints->{48,20}]

nel[t_]=normal[elica[1,.6]][t]

nel[t_]=normal[elica[1,6/10]][t]

bnel[t_]=binormal[elica[1,6/10]][t]

ParametricPlot3D[elica[1,6/10][t]+.05(-Cos[teta]*nel[t]+Sin[teta]*bnel[t]),{t,Pi/4,5Pi},{teta,0,2Pi},PlotPoints->{48,20}]

ParametricPlot3D[elica[1,6/10][t]+.05t(-Cos[teta]*nel[t]+Sin[teta]*bnel[t]),{t,Pi/4,5Pi},{teta,0,2Pi},PlotPoints->{48,20}]

Manipulate[ParametricPlot3D[elica[h,k][t]+.05t(-Cos[teta]*nel[t]+Sin[teta]*bnel[t]),{t,Pi/4,5Pi},{teta,0,2Pi},PlotPoints->{48,20}],{h,0,1},{k,0,1}]

Manipulate[ParametricPlot3D[elica[h,k][t]+.05t(-Cos[teta]*nel[t]+Sin[teta]*bnel[t]),{t,Pi/4,5Pi},{teta,0,2Pi},PlotPoints->{48,20},RegionFunction->Function[{x,y,z,t,teta},y>0]],{h,0,1},{k,0,1}]

Manipulate[ParametricPlot3D[toro[3,8,8][u,v],{u,0,k*Pi},{v,0,2Pi}],{k,0.1,1}]