# Calculating the mean curvature of a surface - suggestions

I am attempting to calculate the mean curvature [1, 2] of a surface defined by a function of x and y.

My function is rather simple:

f = 1 - 0.05(Cos[2 π x/L] + Sin[2 π x/L])Cos[2 π y/L];

So to calculate the mean curvature, this is what I do (κ is the mean curvature below):

L=79.1829;
f = 1 - 0.05(Cos[2 π x/L] + Sin[2 π x/L])Cos[2 π y/L];
κ=((1 + D[f,x]^2) D[f,y,y]-2 D[f,x]D[f,y]D[D[f,x],y]+
(1+D[f,y]^2)D[f,x,x])/((1 + D[f,x]^2 + D[f,y]^2)^1.5)

And then I plot it as :

(*Surface defined by f*)
Plot3D[
f,
{x, 0, L},
{y, 0, L}
]

(*Plot of kappa*)
Plot3D[
κ,
{x, 0, L},
{y, 0, L}
]

1. I wasn't entirely sure of whether to post this question in math.se or mathematica.se but I did so on mathematica.se since it does have a Mathematica component to it.

2. Is what I am doing correct? I ask because this seems rather trivial.

3. Does anyone have any suggestion as to do this in a better way, perhaps plot it in a better way?

A little background:

I am trying to prove quantitatively that different initial conditions created by the surface like f would engender different amounts of curvature for a fluid dynamics problem.

-
Read thoroughly e.g. : mathematica.stackexchange.com/questions/8895/… –  Artes Nov 5 '12 at 14:32
That's a surface, not a curve... anyway, I gave a routine for the mean curvature here. –  Ｊ. Ｍ. Nov 5 '12 at 14:34
@Artes I actually did. Doesn't seem to be the same thing. It does have certain functions that would be interesting though. –  drN Nov 5 '12 at 14:34
@J.M. Oops! Will make the edit! –  drN Nov 5 '12 at 14:35
A great way to test formulas or code involving curvature is to apply it to objects with known curvature. In this case, when you compute the mean curvature function for a unit sphere you get a constant value of $2$, which is correct. Good test objects (in 3D) for mean curvatures include spheres (of various sizes), any soap bubble (which should have zero mean curvature everywhere), tori, ruled surfaces, and surfaces of revolution. –  whuber Nov 5 '12 at 16:19