modulo[v_]:=(v.v)^(1/2)

(* versore tangente per la curva g[t] *)

tangent[g_][t_]:=Simplify[D[g[tt],tt]/modulo[D[g[tt],tt]]]/.tt->t

(* versore binormale per la curva g[t] *)

binormal[g_][t_]:=Simplify[Cross[D[g[tt],tt],D[g[tt],{tt,2}]]/modulo[Cross[D[g[tt],tt],D[g[tt],{tt,2}]]]]/.tt->t

(* versore normale per la curva g[t] *)

normal[g_][t_]:=Cross[binormal[g][t],tangent[g][t]]

curvatura[g_][t_]:= Simplify[modulo[Cross[D[g[tt],tt],D[g[tt],{tt,2}]]]/modulo[D[g[tt],tt]]^3] /. tt->t

torsione[g_][t_]:=Simplify[(Cross[D[g[tt],tt],D[g[tt],{tt,2}]].D[g[tt],{tt,3}])/modulo[Cross[D[g[tt],tt],D[g[tt],{tt,2}]]]^2] /. tt->t

(* {a*t,a}-h{Sin[t],Cos[t]} raggio=1 *)

cicloide[a_][h_][t_]:={a*t-h*Sin[t],a-h*Cos[t]}

cicloide3D[a_][h_][t_]:={a*t-h*Sin[t],a-h*Cos[t],0}

ipocicloide[a_,b_][t_]:={(a-b)*Cos[t]+b*Cos[(a-b)/b*t],(a-b)*Sin[t]-b*Sin[(a-b)/b*t]}

ipotrocoide[a_,b_][h_][t_]:={(a-b)*Cos[t]+b*h*Cos[(a-b)/b*t],(a-b)*Sin[t]-b*h*Sin[(a-b)/b*t]}

epicicloide[a_,b_][t_]:={(a+b)*Cos[t]-b*Cos[(a+b)/b*t],(a+b)*Sin[t]-b*Sin[(a+b)/b*t]}

epitrocoide[a_,b_][h_][t_]:={(a+b)*Cos[t]-b*h*Cos[(a+b)/b*t],(a+b)*Sin[t]-b*h*Sin[(a+b)/b*t]}

ellisse3d[x0_,y0_][a_,b_][t_]:={x0+a*Cos[t],y0+b*Sin[t],0}

epitrocoide3d[a_,b_][h_][t_]:={(a+b)*Cos[t]-b*h*Cos[(a+b)/b*t],(a+b)*Sin[t]-b*h*Sin[(a+b)/b*t],0}

ipotrocoide3d[a_,b_][h_][t_]:={(a-b)*Cos[t]+b*h*Cos[(a-b)/b*t],(a-b)*Sin[t]-b*h*Sin[(a-b)/b*t],0}

ParametricPlot[{t*(t-1),t(t-1)(2t-1)},{t,-.1,1.1}]

Manipulate[Show[{
ParametricPlot[{1-5Cos[t]+Cos[2t],5Sin[t]-Sin[2t]},{t,0,2Pi},PlotRange->{{-5,8},{-6,6}}],
ParametricPlot[{xc+r*Cos[t],yc+r*Sin[t]},{t,0,2Pi},PlotStyle->{Red,Thickness[0.01]}]
}],{{xc,1.61},-3,7},{{yc,0},-5,5},{{r,5.41},0,7}]

Manipulate[Show[{
ParametricPlot[{1-5Cos[t]+Cos[2t],5Sin[t]-Sin[2t]},{t,0,2Pi}],
ParametricPlot[{xc+r*Cos[t],yc+r*Sin[t]},{t,0,2Pi},PlotStyle->{Red,Thickness[0.01]}]
}],{xc,-3,7},{yc,-5,5},{r,0,7}]

Show[{
ParametricPlot[{1-5Cos[t]+Cos[2t],5Sin[t]-Sin[2t]},{t,0,2Pi}],
ParametricPlot[{Cos[t],Sin[t]},{t,0,2Pi}]
}]

Manipulate[ParametricPlot[{1-k*Cos[t]+Cos[2t],k*Sin[t]-Sin[2t]},{t,0,2Pi}],{k,0,5}]

ParametricPlot3D[{Cos[t],Sin[t],Sin[10t]},{t,0,2Pi}]

gamma[t_]:={1-2Cos[t]+Cos[2t],2Sin[t]-Sin[2t],Sin[t]^2}

Manipulate[Show[{ParametricPlot3D[gamma[t],{t,0,2Pi}],Graphics3D[{Red,Sphere[gamma[tfix],0.1]}]}],{tfix,0,2Pi}]

Manipulate[Show[{ParametricPlot3D[{1-2Cos[t]+Cos[2t],2Sin[t]-Sin[2t],Sin[t]^2},{t,0,2Pi}],Graphics3D[Sphere[{1-2Cos[t]+Cos[2t],2Sin[t]-Sin[2t],Sin[t]^2}/.t->tfix,0.1]]}],{tfix,0,2Pi}]

ParametricPlot3D[{1-2Cos[t]+Cos[2t],2Sin[t]-Sin[2t],Sin[t]^2},{t,0,2Pi}]

ParametricPlot3D[{1-2Cos[t]+Cos[2t],2Sin[t]-Sin[2t],0},{t,0,2Pi}]

ParametricPlot[{1-2Cos[t]+Cos[2t],2Sin[t]-Sin[2t]},{t,0,2Pi}]

ParametricPlot[{1-Cos[t]+Cos[2t],Sin[t]-Sin[2t]},{t,0,2Pi}]

ParametricPlot[{1-2Cos[t]+Cos[2t],Sin[t]-Sin[2t]},{t,0,2Pi}]

cicloide3D[1][1][t]

ParametricPlot3D[{Sin[t],Sin[2t],Cos[t]},{t,0,4Pi}]

ParametricPlot3D[{t-Sin[t],0,1-Cos[t]},{t,0,4Pi}]

ParametricPlot3D[{t-Sin[t],1-Cos[t],0},{t,0,4Pi}]

ParametricPlot3D[cicloide3D[1][1][t],{t,0,4Pi}]

cicloide[1][1][t]

ParametricPlot[cicloide[1][1][t],{t,0,4Pi}]

Manipulate[ParametricPlot[cicloide[1][1][t],{t,0,4Pi},Epilog->Point[cicloide[1][1][k]]],{k,0,4Pi}]

Manipulate[ParametricPlot[cicloide[1][1][t],{t,0.0001,k},PlotRange->{{0,4Pi},{0,2}},Epilog->Point[cicloide[1][1][k]]],{k,0,4Pi}]

(* centro=(a*t,a)   a=1  *)

Manipulate[ParametricPlot[cicloide[1][1][t],{t,0.0001,k},PlotRange->{{0,4Pi},{0,2}},Epilog->{Point[cicloide[1][1][k]],Circle[{k,1},1]}],{k,0,4Pi}]

Manipulate[ParametricPlot[cicloide[1][1][t],{t,0.0001,k},PlotRange->{{0,4Pi},{0,2}},Epilog->{Point[cicloide[1][1][k]],Circle[{k,1},1],Line[{{k,1},cicloide[1][1][k]}]}],{k,0,4Pi}]

cicloide[1][1][t]

Manipulate[ParametricPlot[cicloide[1][1][t],{t,0,k},PlotRange->{{0,6Pi},{0,2}},Epilog->{Circle[{k,1},1],Point[cicloide[1][1][k]],Line[{{k,1},cicloide[1][1][k]}]}],{k,0.0001,6Pi}]

ipocicloide[3,1][t]

Manipulate[ParametricPlot[ipocicloide[3,1][t],{t,0,k},PlotRange->{{-3,3},{-3,3}},ImageSize->200,Epilog->{Circle[{0,0},3],Circle[{2Cos[k],2Sin[k]},1],Point[ipocicloide[3,1][k]],Line[{{2Cos[k],2Sin[k]},ipocicloide[3,1][k]}]}],{k,0.0001,4Pi}]

Manipulate[ParametricPlot[ipocicloide[a,b][t],{t,0,k},PlotRange->{{-a,a},{-a,a}},ImageSize->150,Epilog->{Circle[{0,0},a],Circle[{(a-b)Cos[k],(a-b)Sin[k]},b],Point[ipocicloide[a,b][k]],Line[{{(a-b)Cos[k],(a-b)Sin[k]},ipocicloide[a,b][k]}]}],{{a,3},1,7},{{b,1},0.01,5},{k,0.0001,100Pi}]

epicicloide[3,1][t]

Manipulate[ParametricPlot[epicicloide[a,b][t],{t,0,k},PlotRange->{{-a-2b,a+2b},{-a-2b,a+2b}},ImageSize->150,Epilog->{Circle[{0,0},a],Circle[{(a+b)Cos[k],(a+b)Sin[k]},b],Point[epicicloide[a,b][k]],Line[{{(a+b)Cos[k],(a+b)Sin[k]},epicicloide[a,b][k]}]}],{{a,3},1,10},{{b,1},0.01,10},{k,0.0001,100Pi}]

curvatura[ellisse3d[0,0][2,1]][t]

curvatura[ipotrocoide3d[2,1][1/3]][t]

curvatura[epitrocoide3d[2,1][1/3]][t]

Plot[curvatura[ellisse3d[0,0][2,1]][t],{t,0,2Pi},PlotRange->{0,2}]

Plot[curvatura[ipotrocoide3d[2,1][3]][t],{t,0,2Pi},PlotRange->{0,1}]

Plot[curvatura[epitrocoide3d[2,1][1/3]][t],{t,0,2Pi},PlotRange->{0,0.5}]

ParametricPlot[epitrocoide[a,b][h][t],{t,0,k},PlotRange->{{-a-(h+1)*b,a+(h+1)*b},{-a-(h+1)*b,a+(h+1)*b}},ImageSize->150,Epilog->{Circle[{0,0},a],Circle[{(a+b)Cos[k],(a+b)Sin[k]},b],Point[epitrocoide[a,b][h][k]],Line[{{(a+b)Cos[k],(a+b)Sin[k]},epitrocoide[a,b][h][k]}]}]/.{a->2,b->1,h->1/3,k->5.4}

Options[Plot]

GraphicsRow[{ParametricPlot[epitrocoide[a,b][h][t],{t,0,k},PlotRange->{{-3.5,3.5},{-3.5,3.5}},AxesLabel->{x,y},Ticks->None,ImageSize->150,Epilog->{Circle[{0,0},a],Circle[{(a+b)Cos[k],(a+b)Sin[k]},b],Point[epitrocoide[a,b][h][k]],Line[{{(a+b)Cos[k],(a+b)Sin[k]},epitrocoide[a,b][h][k]}]}]/.{a->2,b->1,h->1/3,k->5.4},Plot[curvatura[epitrocoide3d[2,1][1/3]][t],{t,0,2Pi},PlotRange->{{0,2Pi},{0,.5}},Ticks->{{0,Pi,2Pi},{0,.2,.4}},AxesLabel->{t,K}]},PlotLabel->"a)   h = (1/3)"]