Vizualizacije Gaussove i srednje zakrivljenosti ploha

Definicije

paketi

<< Graphics`ParametricPlot3D`

definicije funkcija Gaussove i srednje zakrivljenosti

ee[x_][u_, v_] := 
      FullSimplify[D[x[uu, vv], uu] . D[x[uu, vv], uu]] /. {uu -> u, 
          vv -> v}

ff[x_][u_, v_] := 
      FullSimplify[D[x[uu, vv], uu] . D[x[uu, vv], vv]] /. {uu -> u, 
          vv -> v}

gg[x_][u_, v_] := 
      FullSimplify[D[x[uu, vv], vv] . D[x[uu, vv], vv]] /. {uu -> u, 
          vv -> v}

N0[x_][u_, v_] := 
      FullSimplify[
          Cross[D[x[uu, vv], uu], D[x[uu, vv], vv]]/
            Sqrt[Cross[D[x[uu, vv], uu], D[x[uu, vv], vv]] . 
                Cross[D[x[uu, vv], uu], D[x[uu, vv], vv]]]] /. {uu -> u, 
          vv -> v}

ll[x_][u_, v_] := 
      FullSimplify[
          D[x[uu, vv], uu, uu] . N0[x][uu, vv]] /. {uu -> u, 
          vv -> v}

mm[x_][u_, v_] := 
      FullSimplify[
          D[x[uu, vv], uu, vv] . N0[x][uu, vv]] /. {uu -> u, 
          vv -> v}

nn[x_][u_, v_] := 
      FullSimplify[
          D[x[uu, vv], vv, vv] . N0[x][uu, vv]] /. {uu -> u, 
          vv -> v}

GZ[x_][u_, v_] := 
      FullSimplify[(ll[x][uu, vv]*nn[x][uu, vv] - mm[x][uu, 
                    vv]*mm[x][uu, vv])/(ee[x][uu, vv]*gg[x][
                    uu, vv] - ff[x][uu, vv]*ff[x][uu, 
                    vv])] /. {uu -> u, vv -> v}

SZ[x_][u_, v_] := 
      FullSimplify[
          1/2 (ee[x][uu, vv]*nn[x][uu, vv] - 
                  2  mm[x][uu, vv]*ff[x][uu, vv] + gg[x][uu, 
                      vv]*ll[x][uu, vv])/(ee[x][uu, vv]*gg[x][
                      uu, vv] - ff[x][uu, vv]*ff[x][uu, 
                      vv])] /. {uu -> u, vv -> v}

definicije grafičkih prikaza

dip[ins_][g_] := $DisplayFunction[
        Insert[g, ins, {1, 1}]]

ploha[f_][u_, v_][u0_, u1_, du_][v0_, v1_, dv_][
        opts___]:=ParametricPlot3D[f[u, v],{u, u0, u1, du},{v, v0, v1, dv},DisplayFunction -> 
            dip[EdgeForm[AbsoluteThickness[0.1]]],opts]

grafgauss[f_][u_, v_][u0_, u1_][v0_, v1_][
        opts___]:=
Plot3D[GZ[f][u, v], {u, u0, u1}, {v, v0, v1}, 
        Mesh -> False, opts]

grafsrednja[f_][u_, v_][u0_, u1_][v0_, v1_][
        opts___]:=
Plot3D[SZ[f][u, v], {u, u0, u1}, {v, v0, v1}, 
        Mesh -> False, opts]

bojagauss[f_][u_, v_][u0_, u1_, du_][v0_, v1_, 
          dv_][opts___]:=ParametricPlot3D[Append[f[u, v], Hue[GZ[f][u, v]]],{u, u0, u1, du},{v, v0, v1, dv},DisplayFunction -> 
            dip[EdgeForm[AbsoluteThickness[0.1]]],
Lighting -> False,opts]

bojasrednja[f_][u_, v_][u0_, u1_, du_][v0_, v1_, 
          dv_][opts___]:=ParametricPlot3D[Append[f[u, v], Hue[3  SZ[f][u, v]]],{u, u0, u1, du},{v, v0, v1, dv},Lighting -> False,DisplayFunction -> 
            dip[EdgeForm[AbsoluteThickness[0.1]]],opts]

Primjer:  hipar (z=x*y)

parametrizacija

xuv[u_, v_] := u;
yuv[u_, v_] := v;
zuv[u_, v_] := u*v;
u0 = -2;
u1 = 2;
du = 0.1;
v0 = -2;
v1 = 2;
dv = 0.1;

crtanje

f[u_, v_] := {xuv[u, v], yuv[u, v], zuv[u, v]}

GZ[f][u, v]

SZ[f][u, v]

ploha[f][u, v][u0, u1, du][v0, v1, dv][
      BoxRatios -> {1, 1, 1}]

grafgauss[f][u, v][u0, u1][v0, v1][PlotPoints -> 100,AxesLabel -> {u, v, GZ},AxesEdge -> {{-1, -1}, {1, -1}, {-1, -1}},
BoxRatios -> {1, 1, 1},PlotRange -> {{-2, 2}, {-2, 2}, {-1, 
              0}},ViewPoint -> {0.9,  -3, 1},Ticks -> {{-1, 0, 1, 2}, {-1, 0, 1, 
              2}, {-0.6, -0.5, -0.4, -0.3, -0.2, -0.1, 0}},FaceGrids -> All]

bojagauss[f][u, v][u0, u1, du][v0, v1, dv][
BoxRatios -> {1, 1, 1},AxesLabel -> {x, y, z},
DisplayFunction -> $DisplayFunction,ViewPoint -> {1.1,  -3,  1},Lighting -> False]

grafsrednja[f][u, v][u0, u1][v0, v1][PlotPoints -> 100,AxesLabel -> {u, v, SZ},AxesEdge -> {{-1, -1}, {1, -1}, {-1, -1}},
BoxRatios -> {1, 1, 1},PlotRange -> {{-2, 2}, {-2, 2}, {-0.25, 
              0.25}},ViewPoint -> {0.9,  -3, 1},Ticks -> {{-1, 0, 1, 2}, {-1, 0, 1, 
              2}, {-0.6, -0.5, -0.4, -0.3, -0.2, -0.1, 0}},FaceGrids -> All]

bojasrednja[f][u, v][u0, u1, du][v0, v1, dv][BoxRatios -> {1, 1, 1},AxesLabel -> {x, y, z},
DisplayFunction -> $DisplayFunction,ViewPoint -> {1.1,  -3,  1},Lighting -> False]