Curvatures of a parametrized surface of revolution (source code)

= Curvatures of a parametrized surface of revolution

Put $q=(f'^2+g'^2)^{1/2}$ for the profile parametrization
$$
X(u,v)=(f(v)\cos u,f(v)\sin u,g(v)).
$$
With unit normal $N=(-g'\cos u,-g'\sin u,f')/q$, the <principal curvature>[principal curvatures] are
$$
k_1=\frac{g'}{fq},
\qquad
k_2=\frac{f'g''-g'f''}{q^3}.
$$
Consequently $H=(k_1+k_2)/2$ and $K=k_1k_2$.