(*Differentiation*)

(*Flaeche: Fl, Flaechennormalenvektor: Fln, Tangentialebene: Tane, Normalggerade: Nger, Schnittkurven: Kurvx, Kurvy*)
Fl[x_,y_]=x^2+y^2 (*PlotRange z: 0,9*)
(*Fl[x_,y_]=x^2-y^4 *) (*PlotRange z: -6,6*)
(*Fl[x_,y_]=Log[x^2+y^2]*) (*PlotRange z: -6,6*)
(*Fl[x_,y_]=3*Exp[-(x^2+y^2)]*) (*PlotRange z: 0,6*)
Dxf[x_,y_]=D[Fl[x,y],x]
Dyf[x_,y_]=D[Fl[x,y],y]
Fln[x_,y_]={Dxf[x,y],Dyf[x,y],-1}
Tane[x_,y_,x0_,y0_]={x0,y0,Fl[x0,y0]}+x*{1,0,Dxf[x0,y0]}/Sqrt[1+Dxf[x0,y0]^2]+y*{0,1,Dyf[x0,y0]}/Sqrt[1+Dyf[x0,y0]^2]
Nger[t_,x0_,y0_]={x0,y0,Fl[x0,y0]}+t*Fln[x0,y0]

Kurvx[x_,x0_,y0_]={x,y0,Fl[x,y0]}
Kurvy[y_,x0_,y0_]={x0,y,Fl[x0,y]}

Flb=Plot3D[Fl[x,y] Boole[x^2+y^2≤3],{x,-2,2},{y,-2,2}]

Fls=Plot3D[Fl[x,y],{x,-2,2},{y,-2,2}]

Niveau=ContourPlot3D[Fl[x,y]==Fl[1,1],{x,-2,2},{y,-2,2},{z,Fl[1,1]-0.001,Fl[1,1]+0.001}];
Show[Fls,Niveau]

Tans=Graphics[ParametricPlot3D[Tane[x,y,1,1],{x,-1,1},{y,-1,1},Mesh->None,PlotStyle->{Blue,Opacity[0.8]}]];
Ngers=ParametricPlot3D[Nger[t,1,1],{t,0,1},PlotStyle->{Red,Thickness[0.01]}];
Show[{Fls,Tans,Ngers},PlotRange->All,Boxed->False,Axes->True,ViewPoint->{100,0,-10}]

Kurvxs=ParametricPlot3D[Kurvx[x,1,1],{x,-2,2},PlotStyle->{Green,Thickness[0.01]}];
Kurvys=ParametricPlot3D[Kurvy[y,1,1],{y,-2,2},PlotStyle->{Green,Thickness[0.01]}];
Show[{Fls,Kurvxs,Kurvys},PlotRange->All,ViewPoint->Front]

(*Bild: Name + Buchstabe b*)

Manipulate[
Show[{Graphics[ParametricPlot3D[Tane[x,y,x0,y0],{x,-1,1},{y,-1,1},Mesh->None,PlotStyle->{Blue,Opacity[0.8]}]],
ParametricPlot3D[Nger[t,x0,y0],{t,0,1},PlotStyle->{Red,Thickness[0.01]}],
Plot3D[Fl[x,y],{x,-4,4},{y,-4,4},Mesh->None, PlotStyle->{Yellow,Opacity[0.6]}],
ParametricPlot3D[Kurvx[x,x0,y0],{x,-2,2},PlotStyle->{Green,Thickness[0.01]}],
ParametricPlot3D[Kurvy[y,x0,y0],{y,-2,2},PlotStyle->{Green,Thickness[0.01]}]
},ViewPoint->{5,15,10},ImageSize->{500,380}, Axes->None, Boxed->False,PlotRange->{{-3,3},{-3,3},{0,9}}],
{{x0,1,"x0"},-2.,2.,Appearance-> "Labeled"},
{{y0,1,"y0"},-2.,2.,Appearance-> "Labeled"},
ControlPlacement->Top
]