Application Center - Maplesoft

App Preview:

Gaussian and mean curvature

You can switch back to the summary page by clicking here.

Learn about Maple
Download Application


 

surbasic.mws

Geometry of Surfaces: Basics

by John Oprea

This worksheet contains basic procedures for computing Gauss curvature and mean curvature. Also, several important surfaces and examples of their plots are given. A general reference is J. Oprea, Differential Geometry and its Applications . We start with the usual

> with(plots):

> dp := proc(X,Y)

> X[1]*Y[1]+X[2]*Y[2]+X[3]*Y[3];

> end:

> nrm := proc(X)

> sqrt(dp(X,X));

> end:

> xp := proc(X,Y)

> local a,b,c;

> a := X[2]*Y[3]-X[3]*Y[2];

> b := X[3]*Y[1]-X[1]*Y[3];

> c := X[1]*Y[2]-X[2]*Y[1];

> [a,b,c];

> end:

The next procedure computes the metric E=x_u dot x_u, F=x_u dot x_v and G=x_v dot x_v.

> EFG := proc(X)

> local Xu,Xv,E,F,G;

> Xu := [diff(X[1],u),diff(X[2],u),diff(X[3],u)];
Xv := [diff(X[1],v),diff(X[2],v),diff(X[3],v)];

> E := dp(Xu,Xu);

> F := dp(Xu,Xv);

> G := dp(Xv,Xv);

> simplify([E,F,G]);

> end:

The following procedure gives the unit normal to the input surface X. If you wish to take UN(X), then X must be given in parametrized form in square brackets as done down below.

> UN := proc(X)

> local Xu,Xv,Z,s;

> Xu := [diff(X[1],u),diff(X[2],u),diff(X[3],u)];
Xv := [diff(X[1],v),diff(X[2],v),diff(X[3],v)];

> Z := xp(Xu,Xv);

> s := nrm(Z);

> simplify([Z[1]/s,Z[2]/s,Z[3]/s],sqrt,symbolic);

> end:

The formula for Gauss curvature requires dotting certain second partial derivatives with the unit normal. This is done as follows. See the formulas for K and H given on page 91 and Lemma 2.1 on page 92. Now compare the Examples on pages 93-97 with the calculations below.

> lmn := proc(X)

> local Xu,Xv,Xuu,Xuv,Xvv,U,l,m,n;

> Xu := [diff(X[1],u),diff(X[2],u),diff(X[3],u)];

> Xv := [diff(X[1],v),diff(X[2],v),diff(X[3],v)];

> Xuu := [diff(Xu[1],u),diff(Xu[2],u),diff(Xu[3],u)];

> Xuv := [diff(Xu[1],v),diff(Xu[2],v),diff(Xu[3],v)];

> Xvv := [diff(Xv[1],v),diff(Xv[2],v),diff(Xv[3],v)];

> U := UN(X);

> l := dp(U,Xuu);

> m := dp(U,Xuv);

> n := dp(U,Xvv);

> simplify([l,m,n]);

> end:

Finally we can calculate Gauss curvature K as follows.

> GK := proc(X)

> local E,F,G,l,m,n,S,T;

> S := EFG(X);

> T := lmn(X);

> E := S[1];

> F := S[2];

> G := S[3];

> l := T[1];

> m := T[2];

> n := T[3];

> simplify((l*n-m^2)/(E*G-F^2));

> end:

Mean curvature is given by

> MK := proc(X)

> local E,F,G,l,m,n,S,T;

> S := EFG(X);

> T := lmn(X);

> E := S[1];

> F := S[2];

> G := S[3];

> l := T[1];

> m := T[2];

> n := T[3];

> simplify((G*l+E*n-2*F*m)/(2*E*G-2*F^2));

> end:

You can plot the Gauss curvature over the parameter domain (i.e. how u and v vary). Note that the input `dom` is a list with four entries.

> Gaussplot := proc(X,dom)

> local k;

> k(u,v) := GK(X);

> plot3d(k(u,v),u = dom[1] .. dom[2],v = dom[3] .. dom[4],axes = FRAME, title = `Gaussian Curvature`);

> end:

So here are some parametrizations and ways to calculate Gauss and Mean curvatures.

> Rsphere:=[R*cos(u)*cos(v),R*sin(u)*cos(v),R*sin(v)];

Rsphere := [R*cos(u)*cos(v), R*sin(u)*cos(v), R*sin...

> GK(Rsphere);

1/(R^2)

> simplify(MK(Rsphere),symbolic);

-1/R

The following surface is the catenoid obtained by revolving the catenary about the x-axis. The second command checks that the catenoid is a minimal surface (i.e. zero mean curvature).

> catenoid:=[u,cosh(u)*cos(v),cosh(u)*sin(v)];

catenoid := [u, cosh(u)*cos(v), cosh(u)*sin(v)]

> MK(catenoid);

0

> plot3d(catenoid, u=-2..2, v=0..2*Pi);

[Maple Plot]

The following surface is the helicoid obtained by revolving a moving line about the z-axis. The helicoid is a ruled surface. The second command checks that the helicoid is a minimal surface.

> helicoid:=[u*cos(v),u*sin(v),v];

helicoid := [u*cos(v), u*sin(v), v]

> GK(helicoid); MK(helicoid);

-1/((u^2+1)^2)

0

More surfaces are below. Try to plot some of them using the plot3d command as shown below.

> scherk1:=[u,v,ln(cos(v)/cos(u))];

scherk1 := [u, v, ln(cos(v)/cos(u))]

> MK(scherk1);

0

> moebius:=[cos(u)+v*cos(u/2)*cos(u),sin(u)+v*cos(u/2)*sin(u),sin(u/2)];

moebius := [cos(u)+v*cos(1/2*u)*cos(u), sin(u)+v*co...

> catsurf:=[u-sin(u)*cosh(v),1-cos(u)*cosh(v),4*sin(u/2)*sinh(v/2)];

catsurf := [u-sin(u)*cosh(v), 1-cos(u)*cosh(v), 4*s...

You can plot surfaces from procedures. The following may be used in an animation as shown below.

> helcatplot := proc(t)

> local X;

> X := [cos(Pi*t)*sinh(v)*sin(u)+sin(Pi*t)*cosh(v)*cos(u), -cos(Pi*t)*sinh(v)*cos(u)+sin(Pi*t)*cosh(v)*sin(u),
u*cos(Pi*t)+v*sin(Pi*t)];

> plot3d(X,u=0..3*Pi,v=-1..1,scaling=constrained,shading=XY,orientation=[40,68],grid=[25,5],lightmodel=
light2)

> end:

Next comes Enneper's surface --- another example of a minimal surface, but one which can't be made from a soap film. Why not, do you think? Check that it is minimal.

> enneper:=[u-u^3/3+u*v^2,-v+v^3/3-v*u^2,u^2-v^2];

enneper := [u-1/3*u^3+u*v^2, -v+1/3*v^3-v*u^2, u^2-...

> scherk5 := proc(a,b,c)

> [a*arcsinh(u),b*arcsinh(v),c*arcsin(u*v)];

> end:

> cork:=[cos(u)*cos(v),sin(u)*cos(v),sin(v)+u];

cork := [cos(u)*cos(v), sin(u)*cos(v), sin(v)+u]

> sc5 := proc(a,b,c)

> [a*arcsinh(u),b*arcsinh(v),c*arcsin(u*v)+2.8] ;

> end:

Here are some plots. Notice that you can color plots according to functions. In particular, we can color the helicoid according to its Gauss curvature. So points with similar curvature have the same color in the picture.

> plot3d({scherk5(1,1,1),sc5(1,1,-1)},u=-1..1,v=-1..1,scaling=constrained,style=patch,grid=[13,13]);

[Maple Plot]

> plot3d(helicoid,u=0..1.5,v=0..5*Pi,color=GK(helicoid),orientation=[21,64],style=patch,grid=[10,60]);

[Maple Plot]

> plot3d(enneper,u=-2.2..2.2,v=-2.2..2.2,shading=zhue,style=patch,scaling=constrained,orientation=[90,68]);

[Maple Plot]

The following shows how to anaimate pictures in Maple. The example below shows how the helicoid and catenoid may be deformed isometrically (i.e. preserving distances) into each other. When the helicoid picture comes up, click once directly on it. You should see a frame around the picture and a new tool bar will appear at the top. Click on the forward arrow to start the animation. Test out other arrows to speed up or slow down the animation. The commands below involve creating a sequence (seq) of plots (look at helcatplot) and displaying them one after the other (insequence = true).

> display3d(seq(helcatplot(t/20),t=0..10),insequence=true);

[Maple Plot]

>