(* Copyright 1993 Alfred Gray *)

(*
Get["SURFS.m"];
Get["CSPROGS.m"];

BeginPackage["GCURV`"]
*)


gcurvature[astell[a_,a_,a_]][u_,v_]:=
Sec[v]^4/(9*a^6*(-1 + Cos[v]^2 - Cos[u]^2*Cos[v]^2 + 
       Cos[u]^4*Cos[v]^2)^2)

gcurvature[bohdom[a_,b_,c_]][u_,v_]:=
b*c^2*Cos[v]*Sin[u]/
  (a*(-(c^2*Cos[v]^2) - b^2*Sin[v]^2 +
b^2*Cos[u]^2*Sin[v]^2)^2)

gcurvature[bourpolar[m_][t_]][r_,theta_]:=
-4*r^(4 - 2*m)/(1 + r^2)^4

gcurvature[bourpolar[m_,n_][t_]][r_,theta_]:=
(-4*n^2*r^(2*(1 - m + n)))/(1 + r^(2*n))^4

gcurvature[catalan[a_]][u_,v_]:=
Sech[v/2]^4/(8*a^2*(Cos[u] - Cosh[v]))

gcurvature[catenoid[a_]][u_,v_]:=
-Sech[v/a]^4/a^2

gcurvature[circularcone[a_,b_]][u_,v_]:=
0

gcurvature[circularcylinder[a_]][u_,v_]:=
0

gcurvature[crosscap[a_]][u_,v_]:=
(256*(-2*Cos[2*u] - Cos[2*(u - v)] + 4*Cos[2*v] -
Cos[2*(u + v)])*Sec[v]^2)/
  (a^4*(-30 + 2*Cos[2*u] + 3*Cos[2*u - 4*v] +
4*Cos[2*(u - v)] + 8*Cos[2*v] + 6*Cos[4*v] +
4*Cos[2*(u + v)] + 3*Cos[2*u + 4*v])^2)

gcurvature[cnccosurfrev[a_,b_]][u_,v_]:=
-a^(-2)

gcurvature[cnchysurfrev[a_,b_]][u_,v_]:=
-a^(-2)

gcurvature[cpcsurfrev[a_,b_]][u_,v_]:=
a^(-2)

gcurvature[dini[a_,b_]][u_,v_]:=
-(a^2 + b^2)^(-1)

gcurvature[dinitcheb[a_,b_]][u_,v_]:=
-a^(-2)

gcurvature[ducyc[{p_,0,0},rho_,a_,b_]][u_,v_]:=
((a^2 - b^2 + p^2 - 2*a*p*Cos[u])*
    (-2*a*b - a^2*Cos[v] - b^2*Cos[v] + p^2*Cos[v]))/
  (b*rho^4*(a + b*Cos[v]))

gcurvature[eighteight][u_,v_]:=
-2*Cos[2*v]*(2 + Cos[2*v])*Sin[u]^3*
    (3*Sin[u] + Sin[3*u])*Sin[v]^4/
  (2*Cos[2*v]^2*Sin[v]^2 + Cos[2*u]*Cos[2*v]^2*Sin[v]^2 +
    Cos[4*u]*Cos[2*v]^2*Sin[v]^2 +
  2*Cos[v]^2*Sin[u]^2*Sin[v]^2 +
2*Cos[u]^2*Cos[v]^2*Sin[u]^2*Sin[v]^2 +
Cos[2*u]*Cos[v]^2*Sin[u]^2*Sin[v]^2 +
Cos[u]^2*Cos[2*u]*Cos[v]^2*Sin[u]^2*Sin[v]^2 +
Cos[4*u]*Cos[v]^2*Sin[u]^2*Sin[v]^2 +
Cos[u]^2*Cos[4*u]*Cos[v]^2*Sin[u]^2*Sin[v]^2 -
2*Cos[u]^6*Sin[u]^2*Sin[2*v]^2)^2

gcurvature[eightsurface][u_,v_]:=
4*(2 + Cos[2*v])/(5 + Cos[2*v] + 4*Cos[4*v])^2

gcurvature[ellipticalhyperboloidplus[a_,b_,c_]][u_,v_]:=
-4*a^2*b^2*c^2/
  (a^2*c^2 + b^2*c^2 + 2*a^2*b^2*v^2 + a^2*c^2*v^2 +
b^2*c^2*v^2 - a^2*c^2*Cos[2*u] + b^2*c^2*Cos[2*u] +
a^2*c^2*v^2*Cos[2*u] - b^2*c^2*v^2*Cos[2*u] +
2*a^2*c^2*v*Sin[2*u] - 2*b^2*c^2*v*Sin[2*u])^2

gcurvature[ellipticalhyperboloidminus[a_,b_,c_]][u_,v_]:=
-4*a^2*b^2*c^2/
  (a^2*c^2 + b^2*c^2 + 2*a^2*b^2*v^2 + a^2*c^2*v^2 +
b^2*c^2*v^2 - a^2*c^2*Cos[2*u] + b^2*c^2*Cos[2*u] +
a^2*c^2*v^2*Cos[2*u] - b^2*c^2*v^2*Cos[2*u] -
2*a^2*c^2*v*Sin[2*u] + 2*b^2*c^2*v*Sin[2*u])^2

gcurvature[ellipsoid[a_,b_,c_]][u_,v_]:=
256*a^2*b^2*c^2*Cos[v]^4/
  (16*b^2*c^2*Cos[u]^2*Cos[v]^4 +
16*a^2*c^2*Cos[v]^4*Sin[u]^2 +
16*a^2*b^2*Cos[u]^4*Cos[v]^2*Sin[v]^2 +
16*a^4*Cos[u]^2*Cos[v]^2*Sin[u]^2*Sin[v]^2 +
16*b^4*Cos[u]^2*Cos[v]^2*Sin[u]^2*Sin[v]^2 +
16*a^2*b^2*Cos[v]^2*Sin[u]^4*Sin[v]^2 -
a^4*Sin[2*u]^2*Sin[2*v]^2 +
2*a^2*b^2*Sin[2*u]^2*Sin[2*v]^2 -
b^4*Sin[2*u]^2*Sin[2*v]^2)^2

gcurvature[enneper][u_,v_]:=
-4/(1 + u^2 + v^2)^4

gcurvature[enneperpolar[n_][t_]][r_,theta_]:=
-4*n^2*r^(-2 + 2*n)/(1 + r^(2*n))^4

gcurvature[funnel[a_,b_,c_]][u_,v_]:=
(-4*a^2*b^2*c^2)/
  (a^2*c^2 + b^2*c^2 + 2*a^2*b^2*v^2 - 
     a^2*c^2*Cos[2*u] + b^2*c^2*Cos[2*u])^2

gcurvature[genhypparab[a_,b_]][u_,v_]:=
-4*a^2*b^2/
  (a^2*b^2 + 4*b^2*u^2 + 8*b^2*u*v + 4*a^2*v^2 +
4*b^2*v^2)^2

gcurvature[handkerchief[a_]][u_,v_]:=
4*(-a^2 + u^2 - v^2)/
  (1 + 4*a^2*u^2 + 4*a*u^3 + u^4 + 4*a^2*v^2 -
4*a*u*v^2 + 6*u^2*v^2 + v^4)^2

gcurvature[helicoid[a_,b_,c_]][u_,v_]:=
-4*a^2*b^2*c^2/
  (a^2*c^2 + b^2*c^2 + 2*a^2*b^2*v^2 +
a^2*c^2*Cos[2*u] - b^2*c^2*Cos[2*u])^2

gcurvature[henneberg][u_,v_]:=
Sech[u]^4/(8*(Cos[4*v] - Cosh[4*u]))

gcurvature[hyperbolicparaboloid][u_,v_]:=
-(1 + u^2 + v^2)^(-2)

gcurvature[hyperboloid[a_,b_,c_]][u_,v_]:=
-256*a^2*b^2*c^2*Cosh[v]^4/
  (16*b^2*c^2*Cos[u]^2*Cosh[v]^4 +
16*a^2*c^2*Cosh[v]^4*Sin[u]^2 +
16*a^2*b^2*Cos[u]^4*Cosh[v]^2*Sinh[v]^2 +
16*a^4*Cos[u]^2*Cosh[v]^2*Sin[u]^2*Sinh[v]^2 +
16*b^4*Cos[u]^2*Cosh[v]^2*Sin[u]^2*Sinh[v]^2 +
16*a^2*b^2*Cosh[v]^2*Sin[u]^4*Sinh[v]^2 -
a^4*Sin[2*u]^2*Sinh[2*v]^2 +
2*a^2*b^2*Sin[2*u]^2*Sinh[2*v]^2 -
b^4*Sin[2*u]^2*Sinh[2*v]^2)^2

gcurvature[kuen][u_,v_]:=
-1

gcurvature[kuentcheb[a_]][u_,v_]:=
-a^-2

gcurvature[menn[a_]][u_,v_]:=
-4*(u^2 + 6*a*u^2 + v)/
  (1 + u^4 + 16*a^2*u^6 - 4*u^2*v + 16*a*u^4*v + 4*v^2 +
4*u^2*v^2)^2

gcurvature[mercatorellipsoid[a_,b_,c_]][u_,v_]:=
4*a^2*b^2*c^2*Cosh[v]^4/
  (-(a^2*b^2) + a^2*c^2 + b^2*c^2 - a^2*c^2*Cos[2*u] +
b^2*c^2*Cos[2*u] + a^2*b^2*Cosh[2*v])^2

gcurvature[moebiusstrip[a_]][u_,v_]:=
-4/(a^2*(4 + 3*v^2 + 8*v*Cos[u/2] + 2*v^2*Cos[u])^2)

gcurvature[monkeysaddle][u_,v_]:=
-36*(u^2 + v^2)/(1 + 9*u^4 + 18*u^2*v^2 + 9*v^4)^2

gcurvature[monge[h_]][u_,v_]:=
(-Derivative[1, 1][h][u, v]^2 + 
    Derivative[0, 2][h][u, v]*Derivative[2, 0][h][u, v])/
  (1 + Derivative[0, 1][h][u, v]^2 + 
     Derivative[1, 0][h][u, v]^2)^2

gcurvature[mongepolar[g_]][r_,theta_]:=
(-Derivative[0, 1][g][r, theta]^2 + 
    2*r*Derivative[0, 1][g][r, theta]*
     Derivative[1, 1][g][r, theta] - 
    r^2*Derivative[1, 1][g][r, theta]^2 + 
    r^2*Derivative[0, 2][g][r, theta]*
     Derivative[2, 0][g][r, theta] + 
    r^3*Derivative[1, 0][g][r, theta]*
     Derivative[2, 0][g][r, theta])/
  (r^2 + Derivative[0, 1][g][r, theta]^2 + 
     r^2*Derivative[1, 0][g][r, theta]^2)^2

gcurvature[paraboloid[a_,b_,c_]][u_,v_]:=
(4*a*b - c^2)/
  (1 + 4*a^2*u^2 + c^2*u^2 + 4*a*c*u*v + 4*b*c*u*v +
4*b^2*v^2 + c^2*v^2)^2

gcurvature[plucker][u_,v_]:=
-(u^2 - v^2)^2*(u^2 + v^2)^2/
    (u^4 + u^6 - 2*u^2*v^2 + 3*u^4*v^2 + v^4 +
3*u^2*v^4 + v^6)^2

gcurvature[pluckerpolar[n_]][r_,theta_]:=
-4*n^2*Cos[n*theta]^2/
  (n^2 + 2*r^2 + n^2*Cos[2*n*theta])^2

gcurvature[pluckerpolar[m_,n_]][r_,theta_]:=
(2*(1 - m)*r^(2*m)*(-m^2 - n^2 + 2*m*n^2 + 
      m^2*Cos[2*n*theta] - n^2*Cos[2*n*theta]))/
  (2*r^2 + m^2*r^(2*m) + n^2*r^(2*m) - 
     m^2*r^(2*m)*Cos[2*n*theta] + 
     n^2*r^(2*m)*Cos[2*n*theta])^2

gcurvature[pseudocrosscap][u_,v_]:=
-32*(2 + Cos[2*v])*Sin[v]^4/
  ((-1 + u^2)*(-5 - 10*u^2 - Cos[2*v] +
15*u^2*Cos[2*v] - 4*Cos[4*v] - 6*u^2*Cos[4*v] +
u^2*Cos[6*v])^2)

gcurvature[pseudosphere[a_]][u_,v_]:=
-a^(-2)

gcurvature[pstcheb[a_]][u_,v_]:=
-a^(-2)

gcurvature[richmondpolar[n_][t_]][r_,theta_]:=
(-16*(1 + n)^2*r^(4 + 2*n))/(1 + r^(2 + 2*n))^4

gcurvature[roman[a_]][u_,v_]:=
8192*Sec[v]^4*(-2*Cos[2*u]^2*Cos[v]^4*Cos[2*v]^2 +
 Cos[v]^4*Sin[2*u]^2*Sin[v]^2 +
 3*Cos[v]^4*Cos[2*v]*Sin[2*u]^2*Sin[v]^2)/
  (a^4*(52 + 12*Cos[4*u] + 3*Cos[4*u - 6*v] +
13*Cos[4*u - 2*v] + 10*Cos[4*(u - v)] -
26*Cos[2*v] + 44*Cos[4*v] - 6*Cos[6*v] +
10*Cos[4*(u + v)] + 13*Cos[4*u + 2*v] +
3*Cos[4*u + 6*v])^2)

gcurvature[scherk[a_]][u_,v_]:=
-a^2*Sec[a*u]^2*Sec[a*v]^2/
    (Sec[a*u]^2*Sec[a*v]^2 - Tan[a*u]^2*Tan[a*v]^2)^2

gcurvature[scherk5][u_,v_]:=
-(1 + u^2 + v^2 + u^2*v^2)^(-1)

gcurvature[shoe][u_,v_]:=
-2*u/(1 + u^4 + v^2)^2

gcurvature[sphere[a_]][u_,v_]:=
-a

gcurvature[stereographicellipsoid[a_,b_,c_]][u_,v_]:=
(a^2*b^2*c^2*(1 + u^2 + v^2)^4)/
  (a^2*b^2 - 2*a^2*b^2*u^2 + 4*b^2*c^2*u^2 + 
     a^2*b^2*u^4 - 2*a^2*b^2*v^2 + 4*a^2*c^2*v^2 + 
     2*a^2*b^2*u^2*v^2 + a^2*b^2*v^4)^2

gcurvature[swallowtail][u_,v_]:=
0

gcurvature[thomsen[a_,b_]][u_,v_]:=
-(a^4/(b^2 + 2*b*(1 + b^2)^(1/2)*Cos[a*v]*Cosh[a*u] + 
       Cos[a*v]^2*Cosh[a*u]^2 + 
       b^2*Cos[a*v]^2*Cosh[a*u]^2 + 
       Cosh[a*u]^2*Sin[a*v]^2 + b^2*Sin[a*v]^2*Sinh[a*u]^2
       )^2)

gcurvature[torus[a_,b_,c_]][u_,v_]:=
4*b*c^2*Cos[v]/
  ((a + b*Cos[v])*(-b^2 - c^2 + b^2*Cos[2*v] -
c^2*Cos[2*v])^2)

gcurvature[twiflat[pm_,a_,c_][sl_]][u_,v_]:=
(-c^8 + c^6*sl^2 + 3*a^2*c^6*v^2 - 3*a^2*c^4*sl^2*v^2 -
    2*a^4*c^4*v^4 + a^4*c^4*pm^2*v^4 +
   3*a^4*c^2*sl^2*v^4 - a^6*c^2*pm^2*v^6 -
a^6*sl^2*v^6 + 2*a^4*c^2*pm*v^4*(-c^2 + a^2*v^2))/
  (c^4*(-c^2 + a^2*v^2)^(1/2) -
c^2*sl^2*(-c^2 + a^2*v^2)^(1/2) -
c^2*v^2*(-c^2 + a^2*v^2)^(1/2) -
2*a^2*c^2*pm*v^2*(-c^2 + a^2*v^2)^(1/2) +
a^2*sl^2*v^2*(-c^2 + a^2*v^2)^(1/2) +
a^2*v^4*(-c^2 + a^2*v^2)^(1/2) +
a^4*v^4*(-c^2 + a^2*v^2)^(1/2))^2


gcurvature[twisphere[a_,b_]][u_,v_]:=
(a^2*Cos[v]^4 - b^2*Sin[v]^4)/
  (b^2 + a^2*Cos[v]^2 - b^2*Cos[v]^2)^2

gcurvature[wallis[a_,b_,c_]][u_,v_]:=
8*b^4*c^2*(-2*a^2 + b^2 + b^2*Cos[2*u])*Sin[2*u]^2/
  (-(b^4*c^2) - 8*a^2*v^2 + 4*b^2*v^2 +
4*b^2*v^2*Cos[2*u] + b^4*c^2*Cos[4*u])^2

gcurvature[whitneyumbrella][u_,v_]:=
-4*v^2/(u^2 + 4*v^2 + 4*v^4)^2

gcurvature[wrinkles[a_]][u_,v_]:=
-a^2*u^4*v^4*(-u + v)^2*(u + v)^2/
    (a^2*u^6 - a^2*u^4*v^2 - a^2*u^2*v^4 + u^4*v^4 +
a^2*v^6)^2

mcurvature[astell[a_,a_,a_]][u_,v_]:=
(2^(1/2)*(-66 + 2*Cos[4*u] + 4*Cos[4*u - 2*v] + 
       3*Cos[4*(u - v)] + 56*Cos[2*v] - 6*Cos[4*v] + 
       3*Cos[4*(u + v)] + 4*Cos[4*u + 2*v])*Csc[2*u]*
     Csc[v]*Sec[v]^3)/
   (3*a^3*(18 - 2*Cos[4*u] - Cos[4*u - 2*v] - 
        14*Cos[2*v] - Cos[4*u + 2*v])^(1/2)*
     (-18 + 2*Cos[4*u] + Cos[4*u - 2*v] + 14*Cos[2*v] + 
       Cos[4*u + 2*v]))


mcurvature[bohdom[a_,b_,c_]][u_,v_]:=
(c^3*Cos[v]^3 + a*b*c*Sin[u] + b^2*c*Cos[v]*Sin[v]^2)/
  (2*(-(c^2*Cos[v]^2) - b^2*Sin[v]^2 + 
      b^2*Cos[u]^2*Sin[v]^2)*
    (a^2*c^2*Cos[v]^2 + a^2*b^2*Sin[v]^2 - 
       a^2*b^2*Cos[u]^2*Sin[v]^2)^(1/2))


mcurvature[bourpolar[m_][t_]][r_,theta_]:=
0

mcurvature[bourpolar[m_,n_][t_]][r_,theta_]:=
0

mcurvature[catalan[a_]][u_,v_]:=
0

mcurvature[catenoid[a_]][u_,v_]:=
0

mcurvature[circularcone[a_,b_]][u_,v_]:=
-b/(2*a*(a^2 + b^2)^(1/2)*v)

mcurvature[circularcylinder[a_]][u_,v_]:=
-1/(2*a)

mcurvature[crosscap[a_]][u_,v_]:=
(2*2^(1/2)*Sec[v]^6*(-42*Cos[v]^4*Sin[u] -  
      2*Cos[2*u]*Cos[v]^4*Sin[u] + 
       Cos[2*u - 4*v]*Cos[v]^4*Sin[u] + 
       2*Cos[2*(u - v)]*Cos[v]^4*Sin[u] - 
       46*Cos[v]^4*Cos[2*v]*Sin[u] + 
       6*Cos[2*u]*Cos[v]^4*Cos[2*v]*Sin[u] + 
       3*Cos[2*u - 4*v]*Cos[v]^4*Cos[2*v]*Sin[u] + 
       2*Cos[v]^4*Cos[4*v]*Sin[u] + 
       6*Cos[v]^4*Cos[2*v]*Cos[4*v]*Sin[u] + 
       2*Cos[v]^4*Cos[2*(u + v)]*Sin[u] + 
       Cos[v]^4*Cos[2*u + 4*v]*Sin[u] + 
       3*Cos[v]^4*Cos[2*v]*Cos[2*u + 4*v]*Sin[u] - 
       32*Cos[u]^2*Cos[v]^4*Cos[2*v]*Sin[u]*Sin[v]^2))/
   (a^2*(30 - 2*Cos[2*u] - 3*Cos[2*u - 4*v] - 
        4*Cos[2*(u - v)] - 8*Cos[2*v] - 6*Cos[4*v] - 
        4*Cos[2*(u + v)] - 3*Cos[2*u + 4*v])^(1/2)*
     (-30 + 2*Cos[2*u] + 3*Cos[2*u - 4*v] + 
       4*Cos[2*(u - v)] + 8*Cos[2*v] + 6*Cos[4*v] + 
       4*Cos[2*(u + v)] + 3*Cos[2*u + 4*v]))

mcurvature[cnccosurfrev[a_,b_]][u_,v_]:=
((a^2 - b^2)^(1/2)*(-a^2 + b^2*Cosh[(2*v)/a])*
     (-2*a^2 + b^2 + b^2*Cosh[(2*v)/a])^(1/2)*Csch[v/a])/
   (2^(1/2)*(-a^2 + b^2)^(1/2)*
     (2*a^3*b - a*b^3 - a*b^3*Cosh[(2*v)/a]))

mcurvature[cnchysurfrev[a_,b_]][u_,v_]:=
((-a^2 + b^2*Cosh[(2*v)/a])*Sech[v/a])/
   (2^(1/2)*a*b*(2*a^2 + b^2 - b^2*Cosh[(2*v)/a])^(1/2))

mcurvature[cpcsurfrev[a_,b_]][u_,v_]:=
-(((a^2 + b^2*Cos[(2*v)/a])*
       (2*a^2 - b^2 + b^2*Cos[(2*v)/a])^(1/2)*Sec[v/a])/
     (2^(1/2)*(2*a^3*b - a*b^3 + a*b^3*Cos[(2*v)/a])))

mcurvature[dini[a_,b_]][u_,v_]:=
-(Cos[2*v]*Csc[v/2]*Sec[v/2]*Sec[v])/
   (4*(a^2 + b^2)^(1/2))

mcurvature[dinitcheb[a_,b_]][u,v]:=
((a^2*(1 - Sech[Sec[b]*(u - v*Sin[b])]^2)^2 + 
        a^2*Cos[v]^2*Sech[Sec[b]*(u - v*Sin[b])]^2*
         Tanh[Sec[b]*(u - v*Sin[b])]^2 + 
        a^2*Sech[Sec[b]*(u - v*Sin[b])]^2*Sin[v]^2*
         Tanh[Sec[b]*(u - v*Sin[b])]^2)*
      (a^3*Cos[b]^2*Cos[v]^2*
         Sech[Sec[b]*(u - v*Sin[b])]^2 - 
        a^3*Cos[b]^2*Cos[v]^2*
         Sech[Sec[b]*(u - v*Sin[b])]^4 + 
        a^3*Cos[v]^2*Sech[Sec[b]*(u - v*Sin[b])]^4*
         Sin[b]^2 - a^3*Cos[v]^2*
         Sech[Sec[b]*(u - v*Sin[b])]^6*Sin[b]^2 + 
        a^3*Cos[b]^2*Sech[Sec[b]*(u - v*Sin[b])]^2*
         Sin[v]^2 - a^3*Cos[b]^2*
         Sech[Sec[b]*(u - v*Sin[b])]^4*Sin[v]^2 + 
        a^3*Sech[Sec[b]*(u - v*Sin[b])]^4*Sin[b]^2*
         Sin[v]^2 - a^3*Sech[Sec[b]*(u - v*Sin[b])]^6*
         Sin[b]^2*Sin[v]^2 + 
        a^3*Cos[v]^2*Sech[Sec[b]*(u - v*Sin[b])]^2*
         Sin[b]^2*Tanh[Sec[b]*(u - v*Sin[b])]^2 - 
        a^3*Cos[v]^2*Sech[Sec[b]*(u - v*Sin[b])]^4*
         Sin[b]^2*Tanh[Sec[b]*(u - v*Sin[b])]^2 + 
        a^3*Sech[Sec[b]*(u - v*Sin[b])]^2*Sin[b]^2*
        Sin[v]^2*Tanh[Sec[b]*(u - v*Sin[b])]^2 - 
       a^3*Sech[Sec[b]*(u - v*Sin[b])]^4*Sin[b]^2*
        Sin[v]^2*Tanh[Sec[b]*(u - v*Sin[b])]^2) + 
    (a^3*Cos[v]^2*Sech[Sec[b]*(u - v*Sin[b])]^4 - 
       a^3*Cos[v]^2*Sech[Sec[b]*(u - v*Sin[b])]^6 + 
       a^3*Sech[Sec[b]*(u - v*Sin[b])]^4*Sin[v]^2 - 
       a^3*Sech[Sec[b]*(u - v*Sin[b])]^6*Sin[v]^2 - 
       a^3*Cos[v]^2*Sech[Sec[b]*(u - v*Sin[b])]^2*
        Tanh[Sec[b]*(u - v*Sin[b])]^2 - 
       a^3*Cos[v]^2*Sech[Sec[b]*(u - v*Sin[b])]^4*
        Tanh[Sec[b]*(u - v*Sin[b])]^2 - 
       a^3*Sech[Sec[b]*(u - v*Sin[b])]^2*Sin[v]^2*
        Tanh[Sec[b]*(u - v*Sin[b])]^2 - 
       a^3*Sech[Sec[b]*(u - v*Sin[b])]^4*Sin[v]^2*
        Tanh[Sec[b]*(u - v*Sin[b])]^2)*
     (a^2*Sech[Sec[b]*(u - v*Sin[b])]^4*Sin[b]^2 + 
       (-(a*Cos[b]*Sech[Sec[b]*(u - v*Sin[b])]*Sin[v]) + 
          a*Cos[v]*Sech[Sec[b]*(u - v*Sin[b])]*Sin[b]*
           Tanh[Sec[b]*(u - v*Sin[b])])^2 + 
       (a*Cos[b]*Cos[v]*Sech[Sec[b]*(u - v*Sin[b])] + 
          a*Sech[Sec[b]*(u - v*Sin[b])]*Sin[b]*Sin[v]*
           Tanh[Sec[b]*(u - v*Sin[b])])^2))/
  (2*(a^2*(1 - Sech[Sec[b]*(u - v*Sin[b])]^2)^2 + 
       a^2*Cos[v]^2*Sech[Sec[b]*(u - v*Sin[b])]^2*
        Tanh[Sec[b]*(u - v*Sin[b])]^2 + 
       a^2*Sech[Sec[b]*(u - v*Sin[b])]^2*Sin[v]^2*
        Tanh[Sec[b]*(u - v*Sin[b])]^2)^(3/2)*
    (a^2*Sech[Sec[b]*(u - v*Sin[b])]^4*Sin[b]^2 + 
       (-(a*Cos[b]*Sech[Sec[b]*(u - v*Sin[b])]*Sin[v]) + 
          a*Cos[v]*Sech[Sec[b]*(u - v*Sin[b])]*Sin[b]*
           Tanh[Sec[b]*(u - v*Sin[b])])^2 + 
       (a*Cos[b]*Cos[v]*Sech[Sec[b]*(u - v*Sin[b])] + 
          a*Sech[Sec[b]*(u - v*Sin[b])]*Sin[b]*Sin[v]*
           Tanh[Sec[b]*(u - v*Sin[b])])^2)^(3/2))

mcurvature[ducyc[{p_,0,0},rho_,a_,b_]][u_,v_]:=
(a^3 - 3*a*b^2 + a*p^2 - 2*a^2*p*Cos[u] - 
    a*b*p*Cos[u - v] - 2*b^3*Cos[v] + 2*b*p^2*Cos[v] - 
    a*b*p*Cos[u + v])/(2*b*rho^2*(a + b*Cos[v]))


mcurvature[eighteight][u_,v_]:=
(3*Cos[2*v]^3*Sin[u]*Sin[v]^2 + 
    3*Cos[v]^2*Cos[2*v]*Sin[u]^3*Sin[v]^2 + 
    3*Cos[u]^2*Cos[v]^2*Cos[2*v]*Sin[u]^3*Sin[v]^2 + 
    Cos[2*v]^3*Sin[3*u]*Sin[v]^2 + 
    Cos[v]^2*Cos[2*v]*Sin[u]^2*Sin[3*u]*Sin[v]^2 + 
    Cos[u]^2*Cos[v]^2*Cos[2*v]*Sin[u]^2*Sin[3*u]*
     Sin[v]^2 - 4*Sin[u]^3*Sin[v]^4 - 
    2*Cos[2*u]*Sin[u]^3*Sin[v]^4 - 
    2*Cos[4*u]*Sin[u]^3*Sin[v]^4 - 
    2*Cos[2*v]*Sin[u]^3*Sin[v]^4 - 
    Cos[2*u]*Cos[2*v]*Sin[u]^3*Sin[v]^4 - 
    Cos[4*u]*Cos[2*v]*Sin[u]^3*Sin[v]^4)/
  (2^(1/2)*(2*Cos[2*v]^2*Sin[v]^2 + 
       Cos[2*u]*Cos[2*v]^2*Sin[v]^2 + 
       Cos[4*u]*Cos[2*v]^2*Sin[v]^2 + 
       2*Cos[v]^2*Sin[u]^2*Sin[v]^2 + 
       2*Cos[u]^2*Cos[v]^2*Sin[u]^2*Sin[v]^2 + 
       Cos[2*u]*Cos[v]^2*Sin[u]^2*Sin[v]^2 + 
       Cos[u]^2*Cos[2*u]*Cos[v]^2*Sin[u]^2*Sin[v]^2 + 
       Cos[4*u]*Cos[v]^2*Sin[u]^2*Sin[v]^2 + 
       Cos[u]^2*Cos[4*u]*Cos[v]^2*Sin[u]^2*Sin[v]^2 - 
       2*Cos[u]^6*Sin[u]^2*Sin[2*v]^2)^(3/2))


mcurvature[eightsurface][u_,v_]:=
((-11 + 3*Cos[2*v] - 2*Cos[4*v])*Csc[v])/
  (2*2^(1/2)*(5 + Cos[2*v] + 4*Cos[4*v])^(3/2))


mcurvature[ellipticalhyperboloidminus[a_,b_,c_]][u_,v_]:=
(2^(1/2)*(a^3*b*c + a*b^3*c - a*b*c^3 - a*b*c^3*v^2 - 
      a*b^3*c*Cos[u]^2 - a*b^3*c*v^2*Cos[u]^2 - 
      a^3*b*c*Cos[2*u] + a*b^3*c*Cos[2*u] - 
      a^3*b*c*Sin[u]^2 - a^3*b*c*v^2*Sin[u]^2 - 
      a^3*b*c*v*Sin[2*u] + a*b^3*c*v*Sin[2*u]))/
  (a^2*c^2 + b^2*c^2 + 2*a^2*b^2*v^2 + a^2*c^2*v^2 + 
     b^2*c^2*v^2 - a^2*c^2*Cos[2*u] + b^2*c^2*Cos[2*u] + 
     a^2*c^2*v^2*Cos[2*u] - b^2*c^2*v^2*Cos[2*u] - 
     2*a^2*c^2*v*Sin[2*u] + 2*b^2*c^2*v*Sin[2*u])^(3/2)


mcurvature[ellipticalhyperboloidplus[a_,b_,c_]][u_,v_]:=
(4*(a^3*b*c + a*b^3*c - a*b*c^3 - a*b*c^3*v^2 - 
      a*b^3*c*Cos[u]^2 - a*b^3*c*v^2*Cos[u]^2 - 
      a^3*b*c*Cos[2*u] + a*b^3*c*Cos[2*u] - 
      a^3*b*c*Sin[u]^2 - a^3*b*c*v^2*Sin[u]^2 + 
      a^3*b*c*v*Sin[2*u] - a*b^3*c*v*Sin[2*u]))/
  (-a^4 - 2*a^2*b^2 - b^4 + 4*b^2*c^2*Cos[u]^2 + 
     4*a^2*c^2*v^2*Cos[u]^2 + 4*b^4*Cos[u]^4 + 
     4*a^2*b^2*v^2*Cos[u]^4 + 2*a^4*Cos[2*u] - 
     2*b^4*Cos[2*u] - a^4*Cos[2*u]^2 + 
     2*a^2*b^2*Cos[2*u]^2 - b^4*Cos[2*u]^2 + 
     8*a^2*c^2*v*Cos[u]*Sin[u] - 
     8*b^2*c^2*v*Cos[u]*Sin[u] + 
     8*a^2*b^2*v*Cos[u]^3*Sin[u] - 
     8*b^4*v*Cos[u]^3*Sin[u] + 4*a^2*c^2*Sin[u]^2 + 
     4*b^2*c^2*v^2*Sin[u]^2 + 
     8*a^2*b^2*Cos[u]^2*Sin[u]^2 + 
     4*a^4*v^2*Cos[u]^2*Sin[u]^2 + 
     4*b^4*v^2*Cos[u]^2*Sin[u]^2 + 
     8*a^4*v*Cos[u]*Sin[u]^3 - 
     8*a^2*b^2*v*Cos[u]*Sin[u]^3 + 4*a^4*Sin[u]^4 + 
     4*a^2*b^2*v^2*Sin[u]^4 - 2*a^4*v*Sin[2*u] + 
     2*b^4*v*Sin[2*u] + 2*a^4*v*Cos[2*u]*Sin[2*u] - 
     4*a^2*b^2*v*Cos[2*u]*Sin[2*u] + 
     2*b^4*v*Cos[2*u]*Sin[2*u] - a^4*v^2*Sin[2*u]^2 + 
     2*a^2*b^2*v^2*Sin[2*u]^2 - b^4*v^2*Sin[2*u]^2)^(3/2)


mcurvature[ellipsoid[a_,b_,c_]][u_,v_]:=
(16*(-(a^3*b*c*Cos[v]^3) - a*b^3*c*Cos[v]^3 + 
      a^3*b*c*Cos[2*u]*Cos[v]^3 - 
      a*b^3*c*Cos[2*u]*Cos[v]^3 - 2*a*b*c^3*Cos[v]^5 - 
      2*a^3*b*c*Cos[u]^2*Cos[v]^3*Sin[v]^2 - 
      2*a*b^3*c*Cos[v]^3*Sin[u]^2*Sin[v]^2))/
  (16*b^2*c^2*Cos[u]^2*Cos[v]^4 + 
     16*a^2*c^2*Cos[v]^4*Sin[u]^2 + 
     16*a^2*b^2*Cos[u]^4*Cos[v]^2*Sin[v]^2 + 
     16*a^4*Cos[u]^2*Cos[v]^2*Sin[u]^2*Sin[v]^2 + 
     16*b^4*Cos[u]^2*Cos[v]^2*Sin[u]^2*Sin[v]^2 + 
     16*a^2*b^2*Cos[v]^2*Sin[u]^4*Sin[v]^2 - 
     a^4*Sin[2*u]^2*Sin[2*v]^2 + 
     2*a^2*b^2*Sin[2*u]^2*Sin[2*v]^2 - 
     b^4*Sin[2*u]^2*Sin[2*v]^2)^(3/2)


mcurvature[enneper][u_,v_]:=
0


mcurvature[enneperpolar[n_][t_]][r_,theta_]:=
0

mcurvature[funnel[a_,b_,c_]][u_,v_]:=
(2^(1/2)*a*b*c*(-c^2 - a^2*v^2*Cos[2*u] + 
      b^2*v^2*Cos[2*u]))/
  (v*(a^2*c^2 + b^2*c^2 + 2*a^2*b^2*v^2 - 
       a^2*c^2*Cos[2*u] + b^2*c^2*Cos[2*u])^(3/2))

mcurvature[genhypparab[a_,b_]][u_,v_]:=
(a*b*(-a^2 + b^2 - 4*u^2 - 8*u*v))/
  (a^2*b^2 + 4*b^2*u^2 + 8*b^2*u*v + 4*a^2*v^2 + 
     4*b^2*v^2)^(3/2)


mcurvature[handkerchief[a_]][u_,v_]:=
(2*u - 4*a^3*u^2 + 3*a*u^4 + u^5 + 4*a^3*v^2 - 
    6*a*u^2*v^2 + 2*u^3*v^2 + 3*a*v^4 - 3*u*v^4)/
  (1 + 4*a^2*u^2 + 4*a*u^3 + u^4 + 4*a^2*v^2 - 
     4*a*u*v^2 + 6*u^2*v^2 + v^4)^(3/2)


mcurvature[helicoid[a_,b_,c_]][u_,v_]:=
(2^(1/2)*a*b*(a^2 - b^2)*c*v*Sin[2*u])/
  (a^2*c^2 + b^2*c^2 + 2*a^2*b^2*v^2 + 
     a^2*c^2*Cos[2*u] - b^2*c^2*Cos[2*u])^(3/2)


mcurvature[henneberg][u_,v_]:=
0


mcurvature[hyperbolicparaboloid][u_,v_]:=
-((u*v)/(1 + u^2 + v^2)^(3/2))


mcurvature[hyperboloid[a_,b_,c_]][u_,v_]:=
(16*(a^3*b*c*Cosh[v]^3 + a*b^3*c*Cosh[v]^3 - 
      a^3*b*c*Cos[2*u]*Cosh[v]^3 + 
      a*b^3*c*Cos[2*u]*Cosh[v]^3 - 2*a*b*c^3*Cosh[v]^5 - 
      2*a^3*b*c*Cos[u]^2*Cosh[v]^3*Sinh[v]^2 - 
      2*a*b^3*c*Cosh[v]^3*Sin[u]^2*Sinh[v]^2))/
  (16*b^2*c^2*Cos[u]^2*Cosh[v]^4 + 
     16*a^2*c^2*Cosh[v]^4*Sin[u]^2 + 
     16*a^2*b^2*Cos[u]^4*Cosh[v]^2*Sinh[v]^2 + 
     16*a^4*Cos[u]^2*Cosh[v]^2*Sin[u]^2*Sinh[v]^2 + 
     16*b^4*Cos[u]^2*Cosh[v]^2*Sin[u]^2*Sinh[v]^2 + 
     16*a^2*b^2*Cosh[v]^2*Sin[u]^4*Sinh[v]^2 - 
     a^4*Sin[2*u]^2*Sinh[2*v]^2 + 
     2*a^2*b^2*Sin[2*u]^2*Sinh[2*v]^2 - 
     b^4*Sin[2*u]^2*Sinh[2*v]^2)^(3/2)


mcurvature[kuen][u_,v_]:=
((-8 + 24*u^2 - 3*u^4 - 24*u^2*Cos[2*v] + 
      4*u^4*Cos[2*v] - u^4*Cos[4*v])*Csc[v/2]*Sec[v/2])/
  (32*u*(2 - u^2 + u^2*Cos[2*v]))

mcurvature[kuentcheb[a_]][u,v]:=
((-3 + 24*u^2 - 8*u^4 - 4*Cosh[2*v] + 24*u^2*Cosh[2*v] - 
      Cosh[4*v])*Sech[v])/
  (16*a*u*(1 - 2*u^2 + Cosh[2*v]))

mcurvature[menn[a_]][u_,v_]:=
(-1 + 6*a*u^2 - 2*a*u^6 - 16*a^2*u^6 + v - 3*u^4*v - 
    24*a*u^4*v + 24*a*u^2*v^2 + 4*v^3)/
  (1 + u^4 + 16*a^2*u^6 - 4*u^2*v + 16*a*u^4*v + 4*v^2 + 
     4*u^2*v^2)^(3/2)


mcurvature[moebiusstrip[a_]][u_,v_]:=
(-2*(2 + 2*v^2 + 4*v*Cos[u/2] + v^2*Cos[u])*Sin[u/2])/
  (a*(4 + 3*v^2 + 8*v*Cos[u/2] + 2*v^2*Cos[u])^(3/2))


gcurvature[mercatorellipsoid[a_,b_,c_]][u_,v_]:=
(4*a^2*b^2*c^2*Cosh[v]^4)/
  (-(a^2*b^2) + a^2*c^2 + b^2*c^2 - a^2*c^2*Cos[2*u] + 
     b^2*c^2*Cos[2*u] + a^2*b^2*Cosh[2*v])^2

mcurvature[monge[h_]][u_,v_]:=
(Derivative[0, 2][h][u, v]*(1 + Derivative[1, 0][h][u, v]^2) - 
    2*Derivative[0, 1][h][u, v]*
     Derivative[1, 0][h][u, v]*Derivative[1, 1][h][u, v] +
    (1 + Derivative[0, 1][h][u, v]^2)*Derivative[2, 0][h][u, v])/
       (2*(1 + Derivative[0, 1][h][u, v]^2 + 
       Derivative[1, 0][h][u, v]^2)^(3/2))

mcurvature[mongepolar[g_]][r_,theta_]:=
(r*Derivative[0, 2][g][r, theta] + 
    r^2*Derivative[1, 0][g][r, theta] + 
    2*Derivative[0, 1][g][r, theta]^2*
     Derivative[1, 0][g][r, theta] + 
    r*Derivative[0, 2][g][r, theta]*
     Derivative[1, 0][g][r, theta]^2 + 
    r^2*Derivative[1, 0][g][r, theta]^3 - 
    2*r*Derivative[0, 1][g][r, theta]*
     Derivative[1, 0][g][r, theta]*
     Derivative[1, 1][g][r, theta] + 
    r^3*Derivative[2, 0][g][r, theta] + 
    r*Derivative[0, 1][g][r, theta]^2*
     Derivative[2, 0][g][r, theta])/
  (2*(r^2 + Derivative[0, 1][g][r, theta]^2 + 
       r^2*Derivative[1, 0][g][r, theta]^2)^(3/2))

mcurvature[monkeysaddle][u_,v_]:=
(27*u*(-u^4 + 2*u^2*v^2 + 3*v^4))/
  (1 + 9*u^4 + 18*u^2*v^2 + 9*v^4)^(3/2)

mcurvature[paraboloid[a_,b_,c_]][u_,v_]:=
(a + b + 4*a^2*b*u^2 - a*c^2*u^2 + 4*a*b*c*u*v - 
    c^3*u*v + 4*a*b^2*v^2 - b*c^2*v^2)/
  (1 + 4*a^2*u^2 + c^2*u^2 + 4*a*c*u*v + 4*b*c*u*v + 
     4*b^2*v^2 + c^2*v^2)^(3/2)

mcurvature[plucker][u_,v_]:=
(-2*u*v*(u^2 + v^2)^(5/2))/
  (u^4 + u^6 - 2*u^2*v^2 + 3*u^4*v^2 + v^4 + 3*u^2*v^4 + 
     v^6)^(3/2)


mcurvature[pluckerpolar[n_]][r_,theta_]:=
-((2^(1/2)*n^2*r*Sin[n*theta])/
    (n^2 + 2*r^2 + n^2*Cos[2*n*theta])^(3/2))

mcurvature[pluckerpolar[m_,n_]][r_,theta_]:=
(r^(-1 + m)*(2*m^2*r^2 - 2*n^2*r^2 + m^3*r^(2*m) + 
      m*n^2*r^(2*m) - 2*m^2*n^2*r^(2*m) - 
      m^3*r^(2*m)*Cos[2*n*theta] + 
      m*n^2*r^(2*m)*Cos[2*n*theta])*Sin[n*theta])/
  (2^(1/2)*(2*r^2 + m^2*r^(2*m) + n^2*r^(2*m) - 
       m^2*r^(2*m)*Cos[2*n*theta] + 
       n^2*r^(2*m)*Cos[2*n*theta])^(3/2))

mcurvature[pseudocrosscap][u_,v_]:=
((17 + 19*u^2 - 8*Cos[2*v] + 8*u^2*Cos[2*v] + 
      7*Cos[4*v] - 27*u^2*Cos[4*v] - 4*Cos[6*v])*Sin[v])/
  (2^(1/2)*(-1 + u^2)*(5 + 10*u^2 + Cos[2*v] - 
       15*u^2*Cos[2*v] + 4*Cos[4*v] + 6*u^2*Cos[4*v] - 
       u^2*Cos[6*v])^(1/2)*
    (-5 - 10*u^2 - Cos[2*v] + 15*u^2*Cos[2*v] - 
      4*Cos[4*v] - 6*u^2*Cos[4*v] + u^2*Cos[6*v]))


mcurvature[pseudosphere[a_]][u_,v_]:=
-(Cos[2*v]*Csc[v/2]*Sec[v/2]*Sec[v])/(4*a)


mcurvature[pstcheb[a_]][u_,v_]:=
((-3 + Cosh[2*u])*Csch[u])/(4*a)


mcurvature[richmondpolar[n_][t_]][r_,theta_]:=
0


mcurvature[roman[a_]][u_,v_]:=
(16*2^(1/2)*Cos[v]^2*(-94 - 18*Cos[4*u] - 
      12*Cos[4*u - 2*v] - 3*Cos[4*(u - v)] + 
      24*Cos[2*v] - 42*Cos[4*v] - 3*Cos[4*(u + v)] - 
      12*Cos[4*u + 2*v])*Sin[2*u]*Sin[v])/
  (a^2*(52 + 12*Cos[4*u] + 3*Cos[4*u - 6*v] + 
       13*Cos[4*u - 2*v] + 10*Cos[4*(u - v)] - 
       26*Cos[2*v] + 44*Cos[4*v] - 6*Cos[6*v] + 
       10*Cos[4*(u + v)] + 13*Cos[4*u + 2*v] + 
       3*Cos[4*u + 6*v])^(3/2))


mcurvature[scherk[a_]][u_,v_]:=
0


mcurvature[scherk5][u_,v_]:=
0


mcurvature[shoe][u_,v_]:=
(-1 + 2*u - u^4 + 2*u*v^2)/(2*(1 + u^4 + v^2)^(3/2))


mcurvature[sphere[a_]][u_,v_]:=
-a

mcurvature[stereographicellipsoid[a_,b_,c_]][u_,v_]:=
(a*b*c*(1 + u^2 + v^2)*
    (a^2 + b^2 - 2*a^2*u^2 + 2*b^2*u^2 + 4*c^2*u^2 + 
      a^2*u^4 + b^2*u^4 + 2*a^2*v^2 - 2*b^2*v^2 + 
      4*c^2*v^2 + 2*a^2*u^2*v^2 + 2*b^2*u^2*v^2 + 
      a^2*v^4 + b^2*v^4))/
  (2*(a^2*b^2 - 2*a^2*b^2*u^2 + 4*b^2*c^2*u^2 + 
       a^2*b^2*u^4 - 2*a^2*b^2*v^2 + 4*a^2*c^2*v^2 + 
       2*a^2*b^2*u^2*v^2 + a^2*b^2*v^4)^(3/2))


mcurvature[swallowtail][u_,v_]:=
(1 + 4*v^2 + v^4)/(4*(u + 6*v^2)*(1 + v^2 + v^4)^(3/2))

mcurvature[thomsen[a_,b_]][u_,v_]:=
0


mcurvature[torus[a_,b_,c_]][u_,v_]:=
(c*(-4*a*b - 5*b^2*Cos[v] - 3*c^2*Cos[v] + 
      b^2*Cos[3*v] - c^2*Cos[3*v]))/
  (2*2^(1/2)*(a + b*Cos[v])*
    (b^2 + c^2 - b^2*Cos[2*v] + c^2*Cos[2*v])^(3/2))

mcurvature[twiflat[pm_,a_,c_][sl_]][u,v]=
(a*(-c^2 + a^2*v^2)^(1/2)*
    (3*a*c^6*pm*v - 3*a*c^4*pm*sl^2*v - a*c^4*pm*v^3 - 
      3*a^3*c^4*pm*v^3 + 5*a^3*c^2*pm*sl^2*v^3 + 
      a^3*c^2*pm*v^5 + a^5*c^2*pm^3*v^5 - 
      2*a^5*pm*sl^2*v^5 - a^7*pm^3*v^7 + 
      (c^6*(-c^2 + a^2*v^2))/(a*v) - 
      (c^4*sl^2*(-c^2 + a^2*v^2))/(a*v) + 
      (c^4*v*(-c^2 + a^2*v^2))/a - 
      2*a*c^2*v^3*(-c^2 + a^2*v^2) + 
      3*a^3*c^2*pm^2*v^3*(-c^2 + a^2*v^2) - 
      a*c^4*pm*v^3*Cos[u]^2 + 
      2*a^3*c^2*pm*v^5*Cos[u]^2 - a^5*pm*v^7*Cos[u]^2 - 
      (c^4*v*(-c^2 + a^2*v^2)*Cos[u]^2)/a + 
      a*c^2*v^3*(-c^2 + a^2*v^2)*Cos[u]^2 - 
      a*c^4*pm*v^3*Sin[u]^2 + 
      2*a^3*c^2*pm*v^5*Sin[u]^2 - a^5*pm*v^7*Sin[u]^2 - 
      (c^4*v*(-c^2 + a^2*v^2)*Sin[u]^2)/a + 
      a*c^2*v^3*(-c^2 + a^2*v^2)*Sin[u]^2))/
  (2*(-c^6 + c^4*sl^2 + c^4*v^2 + a^2*c^4*v^2 - 
       2*a^2*c^2*sl^2*v^2 - 2*a^2*c^2*v^4 - 
       a^4*c^2*v^4 + a^4*sl^2*v^4 + a^4*v^6 + a^6*v^6 - 
       2*a^2*c^2*pm*v^2*(-c^2 + a^2*v^2))^(3/2))


mcurvature[twisphere[a_,b_]][u_,v_]:=
-(Cos[v]*(b^2 + 2*a^2*Cos[v]^2 + 2*b^2*Sin[v]^2))/
  (2*(a^2*Cos[v]^2 + b^2*Sin[v]^2)^(3/2))


mcurvature[wallis[a_,b_,c_]][u_,v_]:=
(b^2*c*v*(-a^2 + b^2*Cos[u]^2)*
    (3*b^2 - 8*a^2*Cos[2*u] + 4*b^2*Cos[2*u] + 
      b^2*Cos[4*u]))/
  (4*2^(1/2)*(2*a^2 - b^2 - b^2*Cos[2*u])^(1/2)*
    (-2*a^2 + b^2 + b^2*Cos[2*u])*
    (a^2*v^2*Cos[u]^2 - b^2*v^2*Cos[u]^4 + 
      a^2*v^2*Sin[u]^2 + b^4*c^2*Cos[u]^2*Sin[u]^2 - 
      b^2*v^2*Cos[u]^2*Sin[u]^2)*
    ((-(a^2*v^2*Cos[u]^2) + b^2*v^2*Cos[u]^4 - 
         a^2*v^2*Sin[u]^2 - b^4*c^2*Cos[u]^2*Sin[u]^2 + 
  b^2*v^2*Cos[u]^2*Sin[u]^2)/(-a^2 + b^2*Cos[u]^2))^(1/2))


mcurvature[whitneyumbrella][u_,v_]:=
-((u*(1 + 3*v^2))/(u^2 + 4*v^2 + 4*v^4)^(3/2))

mcurvature[wrinkles[a_]][u,v]:=
(a*u^3*v^3*(u^4 + v^4))/
  (a^2*u^6 - a^2*u^4*v^2 - a^2*u^2*v^4 + u^4*v^4 + 
     a^2*v^6)^(3/2)

unitnormal[astell[a_,a_,a_]][u_,v_]:=
{(4*2^(1/2)*Sin[u]*Sin[v])/
   (18 - 2*Cos[4*u] - Cos[4*u - 2*v] - 14*Cos[2*v] - 
      Cos[4*u + 2*v])^(1/2), 
  (4*2^(1/2)*Cos[u]*Sin[v])/
   (18 - 2*Cos[4*u] - Cos[4*u - 2*v] - 14*Cos[2*v] - 
      Cos[4*u + 2*v])^(1/2), 
  (2*2^(1/2)*Cos[v]*Sin[2*u])/
   (18 - 2*Cos[4*u] - Cos[4*u - 2*v] - 14*Cos[2*v] - 
      Cos[4*u + 2*v])^(1/2)}

unitnormal[bohdom[a_,b_,c_]][u_,v_]:=
{(a*c*Cos[u]*Cos[v])/
   (a^2*c^2*Cos[u]^2*Cos[v]^2 + 
      a^2*c^2*Cos[v]^2*Sin[u]^2 + 
      a^2*b^2*Sin[u]^2*Sin[v]^2)^(1/2), 
  (a*c*Cos[v]*Sin[u])/
   (a^2*c^2*Cos[u]^2*Cos[v]^2 + 
      a^2*c^2*Cos[v]^2*Sin[u]^2 + 
      a^2*b^2*Sin[u]^2*Sin[v]^2)^(1/2), 
  (a*b*Sin[u]*Sin[v])/
   (a^2*c^2*Cos[u]^2*Cos[v]^2 + 
      a^2*c^2*Cos[v]^2*Sin[u]^2 + 
      a^2*b^2*Sin[u]^2*Sin[v]^2)^(1/2)}

unitnormal[bourpolar[m_][t_]][r_,theta_]:=
{(2*r*Cos[theta])/(1 + r^2), (2*r*Sin[theta])/(1 + r^2), 
  (-1 + r^2)/(1 + r^2)}

unitnormal[bourpolar[m_,n_][t_]][r_,theta_]:=
{(2*r^n*Cos[n*theta])/(1 + r^(2*n)), 
  (2*r^n*Sin[n*theta])/(1 + r^(2*n)), 
  (-1 + r^(2*n))/(1 + r^(2*n))}

unitnormal[catalan[a_]][u_,v_]:=
{Cos[u/2]*Sech[v/2], -(Sech[v/2]*Sin[u/2]), -Tanh[v/2]}

unitnormal[catenoid[a_]][u_,v_]:=
{Cos[u]*Sech[v/a], Sech[v/a]*Sin[u], -Tanh[v/a]}

unitnormal[circularcone[a_,b_]][u_,v_]:=
{(b*Cos[u])/(a^2 + b^2)^(1/2), 
  (b*Sin[u])/(a^2 + b^2)^(1/2), -(a/(a^2 + b^2)^(1/2))}

unitnormal[circularcylinder[a_]][u_,v_]:=
{Cos[u], Sin[u], 0}

unitnormal[crosscap[a_]][u_,v_]:=
{(-4*2^(1/2)*Sin[2*v])/
   (30 - 2*Cos[2*u] - 3*Cos[2*u - 4*v] - 
      4*Cos[2*(u - v)] - 8*Cos[2*v] - 6*Cos[4*v] - 
      4*Cos[2*(u + v)] - 3*Cos[2*u + 4*v])^(1/2), 
  (2^(1/2)*Cos[u]*(2*Cos[2*u] + Cos[2*(u - v)] - 
       4*Cos[2*v] + Cos[2*(u + v)]))/
   (30 - 2*Cos[2*u] - 3*Cos[2*u - 4*v] - 
      4*Cos[2*(u - v)] - 8*Cos[2*v] - 6*Cos[4*v] - 
      4*Cos[2*(u + v)] - 3*Cos[2*u + 4*v])^(1/2), 
  (2^(1/2)*(-2 - 2*Cos[2*u] - Cos[2*(u - v)] + 
       2*Cos[2*v] - Cos[2*(u + v)])*Sin[u])/
   (30 - 2*Cos[2*u] - 3*Cos[2*u - 4*v] - 
      4*Cos[2*(u - v)] - 8*Cos[2*v] - 6*Cos[4*v] - 
      4*Cos[2*(u + v)] - 3*Cos[2*u + 4*v])^(1/2)}

unitnormal[cnccosurfrev[a_,b_]][u_,v_]:=
{(Cos[u]*(a^2 - b^2 - b^2*Sinh[v/a]^2)^(1/2))/a, 
  (Sin[u]*(a^2 - b^2 - b^2*Sinh[v/a]^2)^(1/2))/a, 
  -((b*Cosh[v/a])/a)}

unitnormal[cnchysurfrev[a_,b_]][u_,v_]:=
{Cos[u]*((a^2 - b^2*Sinh[v/a]^2)/a^2)^(1/2), 
  Sin[u]*((a^2 - b^2*Sinh[v/a]^2)/a^2)^(1/2), 
  -((b*Sinh[v/a])/a)}

unitnormal[cpcsurfrev[a_,b_]][u_,v_]:=
{Cos[u]*((a^2 - b^2*Sin[v/a]^2)/a^2)^(1/2), 
  Sin[u]*((a^2 - b^2*Sin[v/a]^2)/a^2)^(1/2), 
  (b*Sin[v/a])/a}


unitnormal[dini[a_,b_]][u_,v_]:=
{(a*Cos[u - v] + a*Cos[u + v] - 2*b*Sin[u])/
   (2*(a^2 + b^2)^(1/2)), 
  (2*b*Cos[u] + a*Sin[u - v] + a*Sin[u + v])/
   (2*(a^2 + b^2)^(1/2)), 
  -((a*Sin[v])/(a^2 + b^2)^(1/2))}

unitnormal[dinitcheb[a_,b_]][u_,v_]:=
{(-(a^2*Sech[Sec[b]*(u - v*Sin[b])]^3*Sin[b]*Sin[v]*
        Tanh[Sec[b]*(u - v*Sin[b])]) - 
     a*(1 - Sech[Sec[b]*(u - v*Sin[b])]^2)*
      (a*Cos[b]*Cos[v]*Sech[Sec[b]*(u - v*Sin[b])] + 
        a*Sech[Sec[b]*(u - v*Sin[b])]*Sin[b]*Sin[v]*
         Tanh[Sec[b]*(u - v*Sin[b])]))/
   ((a^2*Cos[v]*Sech[Sec[b]*(u - v*Sin[b])]^3*Sin[b]*
          Tanh[Sec[b]*(u - v*Sin[b])] + 
         a*(1 - Sech[Sec[b]*(u - v*Sin[b])]^2)*
          (-(a*Cos[b]*Sech[Sec[b]*(u - v*Sin[b])]*
               Sin[v]) + 
            a*Cos[v]*Sech[Sec[b]*(u - v*Sin[b])]*Sin[b]*
             Tanh[Sec[b]*(u - v*Sin[b])]))^2 + 
      (-(a^2*Sech[Sec[b]*(u - v*Sin[b])]^3*Sin[b]*Sin[v]*
            Tanh[Sec[b]*(u - v*Sin[b])]) - 
         a*(1 - Sech[Sec[b]*(u - v*Sin[b])]^2)*
          (a*Cos[b]*Cos[v]*Sech[Sec[b]*(u - v*Sin[b])] + 
            a*Sech[Sec[b]*(u - v*Sin[b])]*Sin[b]*Sin[v]*
             Tanh[Sec[b]*(u - v*Sin[b])]))^2 + 
      (a*Sech[Sec[b]*(u - v*Sin[b])]*Sin[v]*
          Tanh[Sec[b]*(u - v*Sin[b])]*
          (-(a*Cos[b]*Sech[Sec[b]*(u - v*Sin[b])]*
               Sin[v]) + 
            a*Cos[v]*Sech[Sec[b]*(u - v*Sin[b])]*Sin[b]*
             Tanh[Sec[b]*(u - v*Sin[b])]) - 
         a*Cos[v]*Sech[Sec[b]*(u - v*Sin[b])]*
          Tanh[Sec[b]*(u - v*Sin[b])]*
          (a*Cos[b]*Cos[v]*Sech[Sec[b]*(u - v*Sin[b])] + 
            a*Sech[Sec[b]*(u - v*Sin[b])]*Sin[b]*Sin[v]*
             Tanh[Sec[b]*(u - v*Sin[b])]))^2)^(1/2), 
  (a^2*Cos[v]*Sech[Sec[b]*(u - v*Sin[b])]^3*Sin[b]*
      Tanh[Sec[b]*(u - v*Sin[b])] + 
     a*(1 - Sech[Sec[b]*(u - v*Sin[b])]^2)*
      (-(a*Cos[b]*Sech[Sec[b]*(u - v*Sin[b])]*Sin[v]) + 
        a*Cos[v]*Sech[Sec[b]*(u - v*Sin[b])]*Sin[b]*
         Tanh[Sec[b]*(u - v*Sin[b])]))/
   ((a^2*Cos[v]*Sech[Sec[b]*(u - v*Sin[b])]^3*Sin[b]*
          Tanh[Sec[b]*(u - v*Sin[b])] + 
         a*(1 - Sech[Sec[b]*(u - v*Sin[b])]^2)*
          (-(a*Cos[b]*Sech[Sec[b]*(u - v*Sin[b])]*
               Sin[v]) + 
            a*Cos[v]*Sech[Sec[b]*(u - v*Sin[b])]*Sin[b]*
             Tanh[Sec[b]*(u - v*Sin[b])]))^2 + 
      (-(a^2*Sech[Sec[b]*(u - v*Sin[b])]^3*Sin[b]*Sin[v]*
            Tanh[Sec[b]*(u - v*Sin[b])]) - 
         a*(1 - Sech[Sec[b]*(u - v*Sin[b])]^2)*
          (a*Cos[b]*Cos[v]*Sech[Sec[b]*(u - v*Sin[b])] + 
            a*Sech[Sec[b]*(u - v*Sin[b])]*Sin[b]*Sin[v]*
             Tanh[Sec[b]*(u - v*Sin[b])]))^2 + 
      (a*Sech[Sec[b]*(u - v*Sin[b])]*Sin[v]*
          Tanh[Sec[b]*(u - v*Sin[b])]*
          (-(a*Cos[b]*Sech[Sec[b]*(u - v*Sin[b])]*
               Sin[v]) + 
            a*Cos[v]*Sech[Sec[b]*(u - v*Sin[b])]*Sin[b]*
             Tanh[Sec[b]*(u - v*Sin[b])]) - 
         a*Cos[v]*Sech[Sec[b]*(u - v*Sin[b])]*
          Tanh[Sec[b]*(u - v*Sin[b])]*
          (a*Cos[b]*Cos[v]*Sech[Sec[b]*(u - v*Sin[b])] + 
            a*Sech[Sec[b]*(u - v*Sin[b])]*Sin[b]*Sin[v]*
             Tanh[Sec[b]*(u - v*Sin[b])]))^2)^(1/2), 
  (a*Sech[Sec[b]*(u - v*Sin[b])]*Sin[v]*
      Tanh[Sec[b]*(u - v*Sin[b])]*
      (-(a*Cos[b]*Sech[Sec[b]*(u - v*Sin[b])]*Sin[v]) + 
        a*Cos[v]*Sech[Sec[b]*(u - v*Sin[b])]*Sin[b]*
         Tanh[Sec[b]*(u - v*Sin[b])]) - 
     a*Cos[v]*Sech[Sec[b]*(u - v*Sin[b])]*
      Tanh[Sec[b]*(u - v*Sin[b])]*
      (a*Cos[b]*Cos[v]*Sech[Sec[b]*(u - v*Sin[b])] + 
        a*Sech[Sec[b]*(u - v*Sin[b])]*Sin[b]*Sin[v]*
         Tanh[Sec[b]*(u - v*Sin[b])]))/
   ((a^2*Cos[v]*Sech[Sec[b]*(u - v*Sin[b])]^3*Sin[b]*
          Tanh[Sec[b]*(u - v*Sin[b])] + 
         a*(1 - Sech[Sec[b]*(u - v*Sin[b])]^2)*
          (-(a*Cos[b]*Sech[Sec[b]*(u - v*Sin[b])]*
               Sin[v]) + 
            a*Cos[v]*Sech[Sec[b]*(u - v*Sin[b])]*Sin[b]*
             Tanh[Sec[b]*(u - v*Sin[b])]))^2 + 
      (-(a^2*Sech[Sec[b]*(u - v*Sin[b])]^3*Sin[b]*Sin[v]*
            Tanh[Sec[b]*(u - v*Sin[b])]) - 
         a*(1 - Sech[Sec[b]*(u - v*Sin[b])]^2)*
          (a*Cos[b]*Cos[v]*Sech[Sec[b]*(u - v*Sin[b])] + 
            a*Sech[Sec[b]*(u - v*Sin[b])]*Sin[b]*Sin[v]*
             Tanh[Sec[b]*(u - v*Sin[b])]))^2 + 
      (a*Sech[Sec[b]*(u - v*Sin[b])]*Sin[v]*
          Tanh[Sec[b]*(u - v*Sin[b])]*
          (-(a*Cos[b]*Sech[Sec[b]*(u - v*Sin[b])]*
               Sin[v]) + 
            a*Cos[v]*Sech[Sec[b]*(u - v*Sin[b])]*Sin[b]*
             Tanh[Sec[b]*(u - v*Sin[b])]) - 
         a*Cos[v]*Sech[Sec[b]*(u - v*Sin[b])]*
          Tanh[Sec[b]*(u - v*Sin[b])]*
          (a*Cos[b]*Cos[v]*Sech[Sec[b]*(u - v*Sin[b])] + 
            a*Sech[Sec[b]*(u - v*Sin[b])]*Sin[b]*Sin[v]*
             Tanh[Sec[b]*(u - v*Sin[b])]))^2)^(1/2)}

unitnormal[ducyc[{p_,0,0},rho_,a_,b_]][u_,v_]:=
{(-4*b*p + 4*a*b*Cos[u] + a^2*Cos[u - v] + 
     b^2*Cos[u - v] + p^2*Cos[u - v] - 4*a*p*Cos[v] + 
     a^2*Cos[u + v] + b^2*Cos[u + v] + p^2*Cos[u + v])/
   (2*(a^2 + b^2 + p^2 - 2*a*p*Cos[u] - b*p*Cos[u - v] + 
       2*a*b*Cos[v] - b*p*Cos[u + v])), 
  ((2*a*b + a^2*Cos[v] + b^2*Cos[v] - p^2*Cos[v])*
     Sin[u])/
   (a^2 + b^2 + p^2 - 2*a*p*Cos[u] - b*p*Cos[u - v] + 
     2*a*b*Cos[v] - b*p*Cos[u + v]), 
  ((-a^2 + b^2 - p^2 + 2*a*p*Cos[u])*Sin[v])/
   (a^2 + b^2 + p^2 - 2*a*p*Cos[u] - b*p*Cos[u - v] + 
     2*a*b*Cos[v] - b*p*Cos[u + v])}

unitnormal[eighteight][u_,v_]:=
{(2*Cos[2*u]*Cos[2*v]*Sin[v])/
   (4*Cos[u]^2*Cos[2*v]^2*Sin[v]^2 + 
      4*Cos[2*u]^2*Cos[2*v]^2*Sin[v]^2 + 
      Sin[u]^6*Sin[2*v]^2)^(1/2), 
  (-2*Cos[u]*Cos[2*v]*Sin[v])/
   (4*Cos[u]^2*Cos[2*v]^2*Sin[v]^2 + 
      4*Cos[2*u]^2*Cos[2*v]^2*Sin[v]^2 + 
      Sin[u]^6*Sin[2*v]^2)^(1/2), 
  (Sin[u]^3*Sin[2*v])/
   (4*Cos[u]^2*Cos[2*v]^2*Sin[v]^2 + 
      4*Cos[2*u]^2*Cos[2*v]^2*Sin[v]^2 + 
      Sin[u]^6*Sin[2*v]^2)^(1/2)}

unitnormal[eightsurface][u_,v_]:=
{(2^(1/2)*Cos[u]*Cos[v])/
   (5 + Cos[2*v] + 4*Cos[4*v])^(1/2), 
  (2^(1/2)*Cos[v]*Sin[u])/
   (5 + Cos[2*v] + 4*Cos[4*v])^(1/2), 
  (-2*2^(1/2)*Cos[2*v])/
   (5 + Cos[2*v] + 4*Cos[4*v])^(1/2)}

unitnormal[ellipticalhyperboloidminus[a_,b_,c_]][u_,v_]:=
{(b*c*(Cos[u] + v*Sin[u]))/
   (a^2*b^2*v^2 + b^2*c^2*Cos[u]^2 + 
      a^2*c^2*v^2*Cos[u]^2 - 2*a^2*c^2*v*Cos[u]*Sin[u] + 
      2*b^2*c^2*v*Cos[u]*Sin[u] + a^2*c^2*Sin[u]^2 + 
      b^2*c^2*v^2*Sin[u]^2)^(1/2), 
  (a*c*(-(v*Cos[u]) + Sin[u]))/
   (a^2*b^2*v^2 + b^2*c^2*Cos[u]^2 + 
      a^2*c^2*v^2*Cos[u]^2 - 2*a^2*c^2*v*Cos[u]*Sin[u] + 
      2*b^2*c^2*v*Cos[u]*Sin[u] + a^2*c^2*Sin[u]^2 + 
      b^2*c^2*v^2*Sin[u]^2)^(1/2), 
  -((a*b*v)/
     (a^2*b^2*v^2 + b^2*c^2*Cos[u]^2 + 
        a^2*c^2*v^2*Cos[u]^2 - 
        2*a^2*c^2*v*Cos[u]*Sin[u] + 
        2*b^2*c^2*v*Cos[u]*Sin[u] + a^2*c^2*Sin[u]^2 + 
        b^2*c^2*v^2*Sin[u]^2)^(1/2))}

unitnormal[ellipticalhyperboloidplus[a_,b_,c_]][u_,v_]:=
{(b*c*(Cos[u] - v*Sin[u]))/
   (a^2*b^2*v^2 + b^2*c^2*Cos[u]^2 + 
      a^2*c^2*v^2*Cos[u]^2 + 2*a^2*c^2*v*Cos[u]*Sin[u] - 
      2*b^2*c^2*v*Cos[u]*Sin[u] + a^2*c^2*Sin[u]^2 + 
      b^2*c^2*v^2*Sin[u]^2)^(1/2), 
  (a*c*(v*Cos[u] + Sin[u]))/
   (a^2*b^2*v^2 + b^2*c^2*Cos[u]^2 + 
      a^2*c^2*v^2*Cos[u]^2 + 2*a^2*c^2*v*Cos[u]*Sin[u] - 
      2*b^2*c^2*v*Cos[u]*Sin[u] + a^2*c^2*Sin[u]^2 + 
      b^2*c^2*v^2*Sin[u]^2)^(1/2), 
  -((a*b*v)/
     (a^2*b^2*v^2 + b^2*c^2*Cos[u]^2 + 
        a^2*c^2*v^2*Cos[u]^2 + 
        2*a^2*c^2*v*Cos[u]*Sin[u] - 
        2*b^2*c^2*v*Cos[u]*Sin[u] + a^2*c^2*Sin[u]^2 + 
        b^2*c^2*v^2*Sin[u]^2)^(1/2))}

unitnormal[ellipsoid[a_,b_,c_]][u_,v_]:=
{(2*b*c*Cos[u]*Cos[v]^2)/
   (4*b^2*c^2*Cos[u]^2*Cos[v]^4 + 
      4*a^2*c^2*Cos[v]^4*Sin[u]^2 + a^2*b^2*Sin[2*v]^2)^
    (1/2), (2*a*c*Cos[v]^2*Sin[u])/
   (4*b^2*c^2*Cos[u]^2*Cos[v]^4 + 
      4*a^2*c^2*Cos[v]^4*Sin[u]^2 + a^2*b^2*Sin[2*v]^2)^
    (1/2), (a*b*Sin[2*v])/
   (4*b^2*c^2*Cos[u]^2*Cos[v]^4 + 
      4*a^2*c^2*Cos[v]^4*Sin[u]^2 + a^2*b^2*Sin[2*v]^2)^
    (1/2)}

unitnormal[enneper][u_,v_]:=
{(2*u)/(1 + u^2 + v^2), (2*v)/(1 + u^2 + v^2), 
  (-1 + u^2 + v^2)/(1 + u^2 + v^2)}

unitnormal[enneperpolar[n_][t_]][r_,theta_]:=
{(2*r^n*Cos[n*theta])/(1 + r^(2*n)), 
  (2*r^n*Sin[n*theta])/(1 + r^(2*n)), 
  (-1 + r^(2*n))/(1 + r^(2*n))}

unitnormal[funnel[a_,b_,c_]][u_,v_]:=
{(b*c*Cos[u])/
   (a^2*b^2*v^2 + b^2*c^2*Cos[u]^2 + a^2*c^2*Sin[u]^2)^
    (1/2), (a*c*Sin[u])/
   (a^2*b^2*v^2 + b^2*c^2*Cos[u]^2 + a^2*c^2*Sin[u]^2)^
    (1/2), (-(a*b*v*Cos[u]^2) - a*b*v*Sin[u]^2)/
   (a^2*b^2*v^2 + b^2*c^2*Cos[u]^2 + a^2*c^2*Sin[u]^2)^
    (1/2)}

unitnormal[genhypparab[a_,b_]][u_,v_]:=
{-((b*(2*u + 2*v))/
     (a^2*b^2 + 4*a^2*v^2 + 4*b^2*(u + v)^2)^(1/2)), 
  (-2*a*u + a*(2*u + 2*v))/
   (a^2*b^2 + 4*a^2*v^2 + 4*b^2*(u + v)^2)^(1/2), 
  (a*b)/(a^2*b^2 + 4*a^2*v^2 + 4*b^2*(u + v)^2)^(1/2)}

unitnormal[handkerchief[a_]][u_,v_]:=
{(-2*a*u - u^2 - v^2)/
   (1 + 4*a^2*u^2 + 4*a*u^3 + u^4 + 4*a^2*v^2 - 
      4*a*u*v^2 + 6*u^2*v^2 + v^4)^(1/2), 
  (2*(a - u)*v)/
   (1 + 4*a^2*u^2 + 4*a*u^3 + u^4 + 4*a^2*v^2 - 
      4*a*u*v^2 + 6*u^2*v^2 + v^4)^(1/2), 
  (1 + 4*a^2*u^2 + 4*a*u^3 + u^4 + 4*a^2*v^2 - 
     4*a*u*v^2 + 6*u^2*v^2 + v^4)^(-1/2)}

unitnormal[helicoid[a_,b_,c_]][u_,v_]:=
{-((b*c*Sin[u])/
     (a^2*b^2*v^2 + a^2*c^2*Cos[u]^2 + b^2*c^2*Sin[u]^2)^
      (1/2)), (a*c*Cos[u])/
   (a^2*b^2*v^2 + a^2*c^2*Cos[u]^2 + b^2*c^2*Sin[u]^2)^
    (1/2), -((a*b*v)/
     (a^2*b^2*v^2 + a^2*c^2*Cos[u]^2 + b^2*c^2*Sin[u]^2)^
      (1/2))}

unitnormal[henneberg][u_,v_]:=
{Cos[v]*Sech[u], -(Sech[u]*Sin[v]), Tanh[u]}

unitnormal[hyperbolicparaboloid][u_,v_]:=
{-(v/(1 + u^2 + v^2)^(1/2)), -(u/(1 + u^2 + v^2)^(1/2)), 
  (1 + u^2 + v^2)^(-1/2)}

unitnormal[hyperboloid[a_,b_,c_]][u_,v_]:=
{(2*b*c*Cos[u]*Cosh[v]^2)/
   (4*b^2*c^2*Cos[u]^2*Cosh[v]^4 + 
      4*a^2*c^2*Cosh[v]^4*Sin[u]^2 + a^2*b^2*Sinh[2*v]^2)^
    (1/2), (2*a*c*Cosh[v]^2*Sin[u])/
   (4*b^2*c^2*Cos[u]^2*Cosh[v]^4 + 
      4*a^2*c^2*Cosh[v]^4*Sin[u]^2 + a^2*b^2*Sinh[2*v]^2)^
    (1/2), -((a*b*Sinh[2*v])/
     (4*b^2*c^2*Cos[u]^2*Cosh[v]^4 + 
        4*a^2*c^2*Cosh[v]^4*Sin[u]^2 + a^2*b^2*Sinh[2*v]^2
        )^(1/2))}

unitnormal[kuen][u_,v_]:=
{(4*u*Cos[u] - 2*u*Cos[u - 2*v] - 2*u*Cos[u + 2*v] - 
     4*Sin[u] + 2*u^2*Sin[u] - u^2*Sin[u - 2*v] - 
     u^2*Sin[u + 2*v])/(2*(-2 - u^2 + u^2*Cos[2*v])), 
  (4*Cos[u] - 2*u^2*Cos[u] + u^2*Cos[u - 2*v] + 
     u^2*Cos[u + 2*v] + 4*u*Sin[u] - 2*u*Sin[u - 2*v] - 
     2*u*Sin[u + 2*v])/(2*(-2 - u^2 + u^2*Cos[2*v])), 
  (2*u*Sin[2*v])/(-2 - u^2 + u^2*Cos[2*v])}

unitnormal[kuentcheb[a_]][u_,v_]:=
{(-4*u*Cos[u] + Sin[u] - 2*u^2*Sin[u] + Cosh[2*v]*Sin[u])/
   (1 + 2*u^2 + Cosh[2*v]), 
  (-Cos[u] + 2*u^2*Cos[u] - Cos[u]*Cosh[2*v] - 
     4*u*Sin[u])/(1 + 2*u^2 + Cosh[2*v]), 
  (4*u*Sinh[v])/(1 + 2*u^2 + Cosh[2*v])}

unitnormal[menn[a_]][u_,v_]:=
{(-2*(2*a*u^3 + u*v))/
   (1 + u^4 + 16*a^2*u^6 - 4*u^2*v + 16*a*u^4*v + 
      4*v^2 + 4*u^2*v^2)^(1/2), 
  (-u^2 + 2*v)/
   (1 + u^4 + 16*a^2*u^6 - 4*u^2*v + 16*a*u^4*v + 
      4*v^2 + 4*u^2*v^2)^(1/2), 
  (1 + u^4 + 16*a^2*u^6 - 4*u^2*v + 16*a*u^4*v + 4*v^2 + 
     4*u^2*v^2)^(-1/2)}

unitnormal[mercatorellipsoid[a_,b_,c_]][u_,v_]:=
{(b*c*Cos[u]*Sech[v]^3)/
   (b^2*c^2*Cos[u]^2*Sech[v]^6 + 
      a^2*c^2*Sech[v]^6*Sin[u]^2 + 
      a^2*b^2*Sech[v]^4*Tanh[v]^2)^(1/2), 
  (a*c*Sech[v]^3*Sin[u])/
   (b^2*c^2*Cos[u]^2*Sech[v]^6 + 
      a^2*c^2*Sech[v]^6*Sin[u]^2 + 
      a^2*b^2*Sech[v]^4*Tanh[v]^2)^(1/2), 
  (a*b*Sech[v]^2*Tanh[v])/
   (b^2*c^2*Cos[u]^2*Sech[v]^6 + 
      a^2*c^2*Sech[v]^6*Sin[u]^2 + 
      a^2*b^2*Sech[v]^4*Tanh[v]^2)^(1/2)}

unitnormal[moebiusstrip[a_]][u_,v_]:=
{((-(v*Cos[u/2]) + 2*Cos[u] + v*Cos[(3*u)/2])*Sin[u/2])/
   (4 + 3*v^2 + 8*v*Cos[u/2] + 2*v^2*Cos[u])^(1/2), 
  (v + 2*Cos[u/2] + 2*v*Cos[u] - 2*Cos[(3*u)/2] - 
     v*Cos[2*u])/
   (2*(4 + 3*v^2 + 8*v*Cos[u/2] + 2*v^2*Cos[u])^(1/2)), 
  (-2*Cos[u/2]*(1 + v*Cos[u/2]))/
   (4 + 3*v^2 + 8*v*Cos[u/2] + 2*v^2*Cos[u])^(1/2)}

unitnormal[monge[h_]][u_,v_]:=
{-(Derivative[1, 0][h][u, v]/
     (1 + Derivative[0, 1][h][u, v]^2 + 
        Derivative[1, 0][h][u, v]^2)^(1/2)), 
  -(Derivative[0, 1][h][u, v]/
     (1 + Derivative[0, 1][h][u, v]^2 + 
        Derivative[1, 0][h][u, v]^2)^(1/2)), 
  (1 + Derivative[0, 1][h][u, v]^2 + 
     Derivative[1, 0][h][u, v]^2)^(-1/2)}

unitnormal[mongepolar[g_]][r_,theta_]:=
{(Sin[theta]*Derivative[0, 1][g][r, theta] - 
     r*Cos[theta]*Derivative[1, 0][g][r, theta])/
   (r^2 + Derivative[0, 1][g][r, theta]^2 + 
      r^2*Derivative[1, 0][g][r, theta]^2)^(1/2), 
  (-(Cos[theta]*Derivative[0, 1][g][r, theta]) - 
     r*Sin[theta]*Derivative[1, 0][g][r, theta])/
   (r^2 + Derivative[0, 1][g][r, theta]^2 + 
      r^2*Derivative[1, 0][g][r, theta]^2)^(1/2), 
  (r*Cos[theta]^2 + r*Sin[theta]^2)/
   (r^2 + Derivative[0, 1][g][r, theta]^2 + 
      r^2*Derivative[1, 0][g][r, theta]^2)^(1/2)}

unitnormal[monkeysaddle][u_,v_]:=
{(3*(-u^2 + v^2))/
   (1 + 9*u^4 + 18*u^2*v^2 + 9*v^4)^(1/2), 
  (6*u*v)/(1 + 9*u^4 + 18*u^2*v^2 + 9*v^4)^(1/2), 
  (1 + 9*u^4 + 18*u^2*v^2 + 9*v^4)^(-1/2)}

unitnormal[paraboloid[a_,b_,c_]][u_,v_]:=
{(-2*a*u - c*v)/
   (1 + 4*a^2*u^2 + c^2*u^2 + 4*a*c*u*v + 4*b*c*u*v + 
      4*b^2*v^2 + c^2*v^2)^(1/2), 
  (-(c*u) - 2*b*v)/
   (1 + 4*a^2*u^2 + c^2*u^2 + 4*a*c*u*v + 4*b*c*u*v + 
      4*b^2*v^2 + c^2*v^2)^(1/2), 
  (1 + 4*a^2*u^2 + c^2*u^2 + 4*a*c*u*v + 4*b*c*u*v + 
     4*b^2*v^2 + c^2*v^2)^(-1/2)}

unitnormal[plucker][u_,v_]:=
{(v*(u^2 - v^2))/
   ((u^2 + v^2)^(1/2)*(u^4 + u^6 - 2*u^2*v^2 + 
        3*u^4*v^2 + v^4 + 3*u^2*v^4 + v^6)^(1/2)), 
  (u*(-u^2 + v^2))/
   ((u^2 + v^2)^(1/2)*(u^4 + u^6 - 2*u^2*v^2 + 
        3*u^4*v^2 + v^4 + 3*u^2*v^4 + v^6)^(1/2)), 
  (u^2 + v^2)^(3/2)/
   (u^4 + u^6 - 2*u^2*v^2 + 3*u^4*v^2 + v^4 + 
      3*u^2*v^4 + v^6)^(1/2)}

unitnormal[pluckerpolar[n_]][r_,theta_]:=
{(2^(1/2)*n*Cos[n*theta]*Sin[theta])/
   (n^2 + 2*r^2 + n^2*Cos[2*n*theta])^(1/2), 
  -((2^(1/2)*n*Cos[theta]*Cos[n*theta])/
     (n^2 + 2*r^2 + n^2*Cos[2*n*theta])^(1/2)), 
  (2^(1/2)*r)/(n^2 + 2*r^2 + n^2*Cos[2*n*theta])^(1/2)}

unitnormal[pluckerpolar[m_,n_]][r_,theta_]:=
{(2^(1/2)*r^m*(n*Cos[n*theta]*Sin[theta] - 
       m*Cos[theta]*Sin[n*theta]))/
   (2*r^2 + m^2*r^(2*m) + n^2*r^(2*m) - 
      m^2*r^(2*m)*Cos[2*n*theta] + 
      n^2*r^(2*m)*Cos[2*n*theta])^(1/2), 
  -((2^(1/2)*r^m*(n*Cos[theta]*Cos[n*theta] + 
         m*Sin[theta]*Sin[n*theta]))/
     (2*r^2 + m^2*r^(2*m) + n^2*r^(2*m) - 
        m^2*r^(2*m)*Cos[2*n*theta] + 
        n^2*r^(2*m)*Cos[2*n*theta])^(1/2)), 
  (2^(1/2)*r)/
   (2*r^2 + m^2*r^(2*m) + n^2*r^(2*m) - 
      m^2*r^(2*m)*Cos[2*n*theta] + 
      n^2*r^(2*m)*Cos[2*n*theta])^(1/2)}

unitnormal[pseudocrosscap][u_,v_]:=
{(2*(-1 + u^2)*Cos[2*v])/
   (Cos[v]^2 - 2*u^2*Cos[v]^2 + u^4*Cos[v]^2 + 
      4*Cos[2*v]^2 - 8*u^2*Cos[2*v]^2 + 
      4*u^4*Cos[2*v]^2 + 16*u^2*Sin[v]^6 - 
      32*u^4*Sin[v]^6 + 16*u^6*Sin[v]^6)^(1/2), 
  ((1 - u^2)*Cos[v])/
   (Cos[v]^2 - 2*u^2*Cos[v]^2 + u^4*Cos[v]^2 + 
      4*Cos[2*v]^2 - 8*u^2*Cos[2*v]^2 + 
      4*u^4*Cos[2*v]^2 + 16*u^2*Sin[v]^6 - 
      32*u^4*Sin[v]^6 + 16*u^6*Sin[v]^6)^(1/2), 
  (4*u*(1 - u^2)*Sin[v]^3)/
   (Cos[v]^2 - 2*u^2*Cos[v]^2 + u^4*Cos[v]^2 + 
      4*Cos[2*v]^2 - 8*u^2*Cos[2*v]^2 + 
      4*u^4*Cos[2*v]^2 + 16*u^2*Sin[v]^6 - 
      32*u^4*Sin[v]^6 + 16*u^6*Sin[v]^6)^(1/2)}

unitnormal[pseudosphere[a_]][u_,v_]:=
{Cos[u]*Cos[v], Cos[v]*Sin[u], -Sin[v]}

unitnormal[pstcheb[a_]][u_,v_]:=
{-(Cos[v]*Tanh[u]), -(Sin[v]*Tanh[u]), -Sech[u]}

unitnormal[richmondpolar[n_][t_]][r_,theta_]:=
{(2*r^(1 + n)*Cos[(1 + n)*theta])/(1 + r^(2 + 2*n)), 
  (2*r^(1 + n)*Sin[(1 + n)*theta])/(1 + r^(2 + 2*n)), 
  (-1 + r^(2 + 2*n))/(1 + r^(2 + 2*n))}

unitnormal[roman[a_]][u_,v_]:=
{(a^4*Sin[4*v])/
   (16*a^8*Cos[u]^2*Cos[2*u]^2*Cos[v]^4*Cos[2*v]^2 + 
      16*a^8*Cos[2*u]^2*Cos[v]^4*Cos[2*v]^2*Sin[u]^2 + 
      4*a^8*Cos[u]^4*Sin[u]^2*Sin[2*v]^4 + 
      4*a^8*Cos[u]^2*Sin[u]^4*Sin[2*v]^4 + a^8*Sin[4*v]^2
      )^(1/2), (2*(-2*a^4*Cos[u]*Cos[2*u]*Cos[v]^2*
        Cos[2*v] + a^4*Cos[u]*Sin[u]^2*Sin[2*v]^2))/
   (16*a^8*Cos[u]^2*Cos[2*u]^2*Cos[v]^4*Cos[2*v]^2 + 
      16*a^8*Cos[2*u]^2*Cos[v]^4*Cos[2*v]^2*Sin[u]^2 + 
      4*a^8*Cos[u]^4*Sin[u]^2*Sin[2*v]^4 + 
      4*a^8*Cos[u]^2*Sin[u]^4*Sin[2*v]^4 + a^8*Sin[4*v]^2
      )^(1/2), (2*(2*a^4*Cos[2*u]*Cos[v]^2*Cos[2*v]*
        Sin[u] + a^4*Cos[u]^2*Sin[u]*Sin[2*v]^2))/
   (16*a^8*Cos[u]^2*Cos[2*u]^2*Cos[v]^4*Cos[2*v]^2 + 
      16*a^8*Cos[2*u]^2*Cos[v]^4*Cos[2*v]^2*Sin[u]^2 + 
      4*a^8*Cos[u]^4*Sin[u]^2*Sin[2*v]^4 + 
      4*a^8*Cos[u]^2*Sin[u]^4*Sin[2*v]^4 + a^8*Sin[4*v]^2
      )^(1/2)}

unitnormal[scherk[a_]][u_,v_]:=
{-(Tan[a*u]/(1 + Tan[a*u]^2 + Tan[a*v]^2)^(1/2)), 
  Tan[a*v]/(1 + Tan[a*u]^2 + Tan[a*v]^2)^(1/2), 
  (1 + Tan[a*u]^2 + Tan[a*v]^2)^(-1/2)}

unitnormal[scherk5][u_,v_]:=
{-(v/(1 + v^2)^(1/2)), -(u/(1 + u^2)^(1/2)), 
  (1 - u^2*v^2)^(1/2)/((1 + u^2)^(1/2)*(1 + v^2)^(1/2))}

unitnormal[shoe][u_,v_]:=
{-(u^2/(1 + u^4 + v^2)^(1/2)), v/(1 + u^4 + v^2)^(1/2), 
  (1 + u^4 + v^2)^(-1/2)}

unitnormal[sphere[a_]][u_,v_]:=
{Cos[u]*Cos[v],Cos[v]*Sin[u],Sin[v]}

unitnormal[stereographicellipsoid[a_,b_,c_]][u_,v_]:=
{(-2*b*c*u)/
   ((1 + u^2 + v^2)^3*((a^2*b^2 - 2*a^2*b^2*u^2 + 
          4*b^2*c^2*u^2 + a^2*b^2*u^4 - 2*a^2*b^2*v^2 + 
          4*a^2*c^2*v^2 + 2*a^2*b^2*u^2*v^2 + a^2*b^2*v^4
          )/(1 + u^2 + v^2)^6)^(1/2)), 
  (-2*a*c*v)/
   ((1 + u^2 + v^2)^3*((a^2*b^2 - 2*a^2*b^2*u^2 + 
          4*b^2*c^2*u^2 + a^2*b^2*u^4 - 2*a^2*b^2*v^2 + 
          4*a^2*c^2*v^2 + 2*a^2*b^2*u^2*v^2 + a^2*b^2*v^4
          )/(1 + u^2 + v^2)^6)^(1/2)), 
  (a*b*(1 - u^2 - v^2))/
   ((1 + u^2 + v^2)^3*((a^2*b^2 - 2*a^2*b^2*u^2 + 
          4*b^2*c^2*u^2 + a^2*b^2*u^4 - 2*a^2*b^2*v^2 + 
          4*a^2*c^2*v^2 + 2*a^2*b^2*u^2*v^2 + a^2*b^2*v^4
          )/(1 + u^2 + v^2)^6)^(1/2))}

unitnormal[swallowtail][u_,v_]:=
{(1 + v^2 + v^4)^(-1/2), v/(1 + v^2 + v^4)^(1/2), 
  v^2/(1 + v^2 + v^4)^(1/2)}

unitnormal[thomsen[a_,b_]][u_,v_]:=
-(a^4/(b^2 + 2*b*(1 + b^2)^(1/2)*Cos[a*v]*Cosh[a*u] + 
       Cos[a*v]^2*Cosh[a*u]^2 + 
       b^2*Cos[a*v]^2*Cosh[a*u]^2 + 
       Cosh[a*u]^2*Sin[a*v]^2 + b^2*Sin[a*v]^2*Sinh[a*u]^2
       )^2)

unitnormal[torus[a_,b_,c_]][u_,v_]:=
{(2^(1/2)*c*Cos[u]*Cos[v])/
   (b^2 + c^2 - b^2*Cos[2*v] + c^2*Cos[2*v])^(1/2), 
  (2^(1/2)*c*Cos[v]*Sin[u])/
   (b^2 + c^2 - b^2*Cos[2*v] + c^2*Cos[2*v])^(1/2), 
  (2^(1/2)*b*Sin[v])/
   (b^2 + c^2 - b^2*Cos[2*v] + c^2*Cos[2*v])^(1/2)}

unitnormal[twiflat[pm_,a_,c_][sl_]][u_,v_]:=
{(-(c^2*(-c^2 + a^2*v^2)^(1/2)*Cos[u]) + 
     a^2*pm*v^2*(-c^2 + a^2*v^2)^(1/2)*Cos[u] - 
     sl*(-c^2 + a^2*v^2)*Sin[u])/
   (-c^6 + c^4*sl^2 + c^4*v^2 + a^2*c^4*v^2 - 
      2*a^2*c^2*sl^2*v^2 - 2*a^2*c^2*v^4 - a^4*c^2*v^4 + 
      a^4*sl^2*v^4 + a^4*v^6 + a^6*v^6 - 
      2*a^2*c^2*pm*v^2*(-c^2 + a^2*v^2))^(1/2), 
  (sl*(-c^2 + a^2*v^2)*Cos[u] - 
     c^2*(-c^2 + a^2*v^2)^(1/2)*Sin[u] + 
     a^2*pm*v^2*(-c^2 + a^2*v^2)^(1/2)*Sin[u])/
   (-c^6 + c^4*sl^2 + c^4*v^2 + a^2*c^4*v^2 - 
      2*a^2*c^2*sl^2*v^2 - 2*a^2*c^2*v^4 - a^4*c^2*v^4 + 
      a^4*sl^2*v^4 + a^4*v^6 + a^6*v^6 - 
      2*a^2*c^2*pm*v^2*(-c^2 + a^2*v^2))^(1/2), 
  -((v*(-c^2 + a^2*v^2))/
     (-c^6 + c^4*sl^2 + c^4*v^2 + a^2*c^4*v^2 - 
        2*a^2*c^2*sl^2*v^2 - 2*a^2*c^2*v^4 - 
        a^4*c^2*v^4 + a^4*sl^2*v^4 + a^4*v^6 + a^6*v^6 - 
        2*a^2*c^2*pm*v^2*(-c^2 + a^2*v^2))^(1/2))}

unitnormal[twisphere[a_,b_]][u_,v_]:=
{(a*Cos[u]*Cos[v]^2 + b*Sin[u]*Sin[v])/
   (a^2*Cos[v]^2 + b^2*Sin[v]^2)^(1/2), 
  (a*Cos[v]^2*Sin[u] - b*Cos[u]*Sin[v])/
   (a^2*Cos[v]^2 + b^2*Sin[v]^2)^(1/2), 
  (a*Cos[v]*Sin[v])/(a^2*Cos[v]^2 + b^2*Sin[v]^2)^(1/2)}

unitnormal[wallis[a_,b_,c_]][u_,v_]:=
{(-2*2^(1/2)*b^2*c*Cos[u]*Sin[u]^2)/
   ((a^2 - b^2*Cos[u]^2)^(1/2)*
     ((-(b^4*c^2) - 8*a^2*v^2 + 8*b^2*v^2*Cos[u]^2 + 
          b^4*c^2*Cos[4*u])/(-a^2 + b^2*Cos[u]^2))^(1/2)),
   (2*2^(1/2)*b^2*c*Cos[u]^2*Sin[u])/
   ((a^2 - b^2*Cos[u]^2)^(1/2)*
     ((-(b^4*c^2) - 8*a^2*v^2 + 8*b^2*v^2*Cos[u]^2 + 
          b^4*c^2*Cos[4*u])/(-a^2 + b^2*Cos[u]^2))^(1/2)),
   (-2*2^(1/2)*v)/
   ((-(b^4*c^2) - 8*a^2*v^2 + 8*b^2*v^2*Cos[u]^2 + 
        b^4*c^2*Cos[4*u])/(-a^2 + b^2*Cos[u]^2))^(1/2)}

unitnormal[whitneyumbrella][u_,v_]:=
{(2*v)/(u^2 + 4*v^2 + 4*v^4)^(1/2), 
  (-2*v^2)/(u^2 + 4*v^2 + 4*v^4)^(1/2), 
  -(u/(u^2 + 4*v^2 + 4*v^4)^(1/2))}

unitnormal[wrinkles[a_]][u_,v_]:=
{(a*v*(-u + v)*(u + v))/
   (a^2*u^6 - a^2*u^4*v^2 - a^2*u^2*v^4 + u^4*v^4 + 
      a^2*v^6)^(1/2), (a*u*(u - v)*(u + v))/
   (a^2*u^6 - a^2*u^4*v^2 - a^2*u^2*v^4 + u^4*v^4 + 
      a^2*v^6)^(1/2), (u^2*v^2)/
   (a^2*u^6 - a^2*u^4*v^2 - a^2*u^2*v^4 + u^4*v^4 + 
      a^2*v^6)^(1/2)}


surfacenormal[astell[a_,a_,a_]][u_,v_]:=
{9*a^6*Cos[u]*Cos[v]^4*Sin[u]^2*Sin[v]^2, 
   9*a^6*Cos[u]^2*Cos[v]^4*Sin[u]*Sin[v]^2, 
   (9*a^6*Cos[v]^5*Sin[2*u]^2*Sin[v])/4}

surfacenormal[bohdom[a_,b_,c_]][u_,v_]:=
{a*c*Cos[u]*Cos[v], a*c*Cos[v]*Sin[u], a*b*Sin[u]*Sin[v]}

surfacenormal[bourpolar[m_][t_]][r_,theta_]:=
{2*r^(-2 + 2*m)*(1 + r^2)*Cos[theta], 
   2*r^(-2 + 2*m)*(1 + r^2)*Sin[theta], 
   r^(-3 + 2*m)*(-1 + r^4)}

surfacenormal[bourpolar[m_,n_][t_]][r_,theta_]:=
Cross[Derivative[1, 0][bourpolar[m, n][t]][r, theta], 
   Derivative[0, 1][bourpolar[m, n][t]][r, theta]]

surfacenormal[catalan[a_]][u_,v_]:=
{a^2*Cos[(3*u)/2]*Cosh[v/2] - 
    a^2*Cos[u/2]*Cosh[(3*v)/2], 
   2*a^2*Cosh[v/2]*(-Cos[u] + Cosh[v])*Sin[u/2], 
   a^2*(-Cos[u] + Cosh[v])*Sinh[v]}


surfacenormal[catenoid[a_]][u_,v_]:=
{a*Cos[u]*Cosh[v/a], a*Cosh[v/a]*Sin[u], 
   -(a*Sinh[(2*v)/a])/2}

surfacenormal[circularcone[a_,b_]][u_,v_]:=
{a*b*(v^2)^(1/2)*Cos[u], a*b*(v^2)^(1/2)*Sin[u], 
   -(a^2*v)}

surfacenormal[circularcylinder[a_]][u_,v_]:=
{a*Cos[u], a*Sin[u], 0}

surfacenormal[crosscap[a_]][u_,v_]:=
{-4*a^4*Cos[v]^3*Sin[v], 
   -2*a^4*Cos[v]^2*Cos[2*v]*Sin[u]*Sin[2*u] + 
    (a^4*(Cos[u] + Cos[3*u])*Sin[2*v]^2)/4, 
   -2*a^4*Cos[2*u]*Cos[v]^2*Cos[2*v]*Sin[u] - 
    a^4*Cos[u]^2*Sin[u]*Sin[2*v]^2}

surfacenormal[cnccosurfrev[a_,b_]][u_,v_]:=
{(b*(a^2 - b^2)^(1/2)*Cos[u]*Sinh[v/a]*
      (1 - (b^2*Sinh[v/a]^2)/(a^2 - b^2))^(1/2))/a, 
   (b*(a^2 - b^2)^(1/2)*Sin[u]*Sinh[v/a]*
      (1 - (b^2*Sinh[v/a]^2)/(a^2 - b^2))^(1/2))/a, 
   -(b^2*Sinh[(2*v)/a])/(2*a)}

surfacenormal[cnchysurfrev[a_,b_]][u_,v_]:=
{b*Cos[u]*Cosh[v/a]*(1 - (b^2*Sinh[v/a]^2)/a^2)^(1/2), 
   b*Cosh[v/a]*Sin[u]*(1 - (b^2*Sinh[v/a]^2)/a^2)^(1/2), 
   -(b^2*Sinh[(2*v)/a])/(2*a)}

surfacenormal[cpcsurfrev[a_,b_]][u_,v_]:=
{b*Cos[u]*Cos[v/a]*(1 - (b^2*Sin[v/a]^2)/a^2)^(1/2), 
   b*Cos[v/a]*Sin[u]*(1 - (b^2*Sin[v/a]^2)/a^2)^(1/2), 
   (b^2*Sin[(2*v)/a])/(2*a)}


surfacenormal[dini[a_,b_]][u_,v_]:=
{a^2*Cos[u]*Cos[v]^2 - a*b*Cos[v]*Sin[u], 
   a*b*Cos[u]*Cos[v] + a^2*Cos[v]^2*Sin[u], 
   -(a^2*Sin[2*v])/2}

surfacenormal[dinitcheb[a_,b_]][u_,v_]:=
{-(a^2*Sech[Sec[b]*(u - v*Sin[b])]^3*Sin[b]*Sin[v]*
       Tanh[Sec[b]*(u - v*Sin[b])]) - 
    a*(1 - Sech[Sec[b]*(u - v*Sin[b])]^2)*
     (a*Cos[b]*Cos[v]*Sech[Sec[b]*(u - v*Sin[b])] + 
       a*Sech[Sec[b]*(u - v*Sin[b])]*Sin[b]*Sin[v]*
        Tanh[Sec[b]*(u - v*Sin[b])]), 
   a^2*Cos[v]*Sech[Sec[b]*(u - v*Sin[b])]^3*Sin[b]*
     Tanh[Sec[b]*(u - v*Sin[b])] + 
    a*(1 - Sech[Sec[b]*(u - v*Sin[b])]^2)*
     (-(a*Cos[b]*Sech[Sec[b]*(u - v*Sin[b])]*Sin[v]) + 
       a*Cos[v]*Sech[Sec[b]*(u - v*Sin[b])]*Sin[b]*
        Tanh[Sec[b]*(u - v*Sin[b])]), 
   a*Sech[Sec[b]*(u - v*Sin[b])]*Sin[v]*
     Tanh[Sec[b]*(u - v*Sin[b])]*
     (-(a*Cos[b]*Sech[Sec[b]*(u - v*Sin[b])]*Sin[v]) + 
       a*Cos[v]*Sech[Sec[b]*(u - v*Sin[b])]*Sin[b]*
        Tanh[Sec[b]*(u - v*Sin[b])]) - 
    a*Cos[v]*Sech[Sec[b]*(u - v*Sin[b])]*
     Tanh[Sec[b]*(u - v*Sin[b])]*
     (a*Cos[b]*Cos[v]*Sech[Sec[b]*(u - v*Sin[b])] + 
       a*Sech[Sec[b]*(u - v*Sin[b])]*Sin[b]*Sin[v]*
        Tanh[Sec[b]*(u - v*Sin[b])])}

surfacenormal[ducyc[{p_,0,0},rho_,a_,b_]][u_,v_]:=
{(b*rho^4*(a + b*Cos[v])*
      (-4*b*p + 4*a*b*Cos[u] + a^2*Cos[u - v] + 
        b^2*Cos[u - v] + p^2*Cos[u - v] - 4*a*p*Cos[v] + 
        a^2*Cos[u + v] + b^2*Cos[u + v] + p^2*Cos[u + v])
      )/(2*(a^2 + b^2 + p^2 - 2*a*p*Cos[u] - 
         b*p*Cos[u - v] + 2*a*b*Cos[v] - b*p*Cos[u + v])^
       3), (b*rho^4*(a + b*Cos[v])*
      (-2*a*b - a^2*Cos[v] - b^2*Cos[v] + p^2*Cos[v])*
      Sin[u])/
    (-a^2 - b^2 - p^2 + 2*a*p*Cos[u] + b*p*Cos[u - v] - 
       2*a*b*Cos[v] + b*p*Cos[u + v])^3, 
   (b*rho^4*(-a^2 + b^2 - p^2 + 2*a*p*Cos[u])*
      (a + b*Cos[v])*Sin[v])/
    (a^2 + b^2 + p^2 - 2*a*p*Cos[u] - b*p*Cos[u - v] + 
       2*a*b*Cos[v] - b*p*Cos[u + v])^3}

surfacenormal[eighteight][u_,v_]:=
{Cos[2*u]*Cos[2*v]*Sin[v], -(Cos[u]*Cos[2*v]*Sin[v]), 
   (Sin[u]^3*Sin[2*v])/2}

surfacenormal[eightsurface][u_,v_]:=
{Cos[u]*Cos[v]*Sin[2*v], Cos[v]*Sin[u]*Sin[2*v], 
   -Sin[4*v]}

surfacenormal[ellipticalhyperboloidminus[a_,b_,c_]][u_,v_]:=
{b*c*(Cos[u] + v*Sin[u]), -(a*c*(v*Cos[u] - Sin[u])), 
   -(a*b*v)}

surfacenormal[ellipticalhyperboloidplus[a_,b_,c_]][u_,v_]:=
{b*c*(Cos[u] - v*Sin[u]), a*c*(v*Cos[u] + Sin[u]), 
   -(a*b*v)}

surfacenormal[ellipsoid[a_,b_,c_]][u_,v_]:=
{b*c*Cos[u]*Cos[v]^2, a*c*Cos[v]^2*Sin[u], 
   (a*b*Sin[2*v])/2}

surfacenormal[enneper][u_,v_]:=
{2*u*(1 + u^2 + v^2), 2*v*(1 + u^2 + v^2), 
   -1 + u^4 + 2*u^2*v^2 + v^4}

surfacenormal[enneperpolar[n_][t_]][r_,theta_]:=
{2*r^(1 + n)*(1 + r^(2*n))*Cos[n*theta], 
   2*r^(1 + n)*(1 + r^(2*n))*Sin[n*theta], 
   r*(-1 + r^(4*n))}

surfacenormal[funnel[a_,b_,c_]][u_,v_]:=
{b*c*Cos[u], a*c*Sin[u], -(a*b*v)}

surfacenormal[genhypparab[a_,b_]][u_,v_]:=
{-2*b*(u + v), 2*a*v, a*b}

surfacenormal[handkerchief[a_]][u_,v_]:=
{-2*a*u - u^2 - v^2, 2*(a - u)*v, 1}

surfacenormal[helicoid[a_,b_,c_]][u_,v_]:=
{-2*a*u - u^2 - v^2, 2*(a - u)*v, 1}

surfacenormal[henneberg][u_,v_]:=
{8*Cos[v]*Cosh[u]*(Cos[4*v] - Cosh[4*u]), 
   8*Cosh[u]*(-Cos[4*v] + Cosh[4*u])*Sin[v], 
   4*(Cos[4*v] - Cosh[4*u])*Sinh[2*u]}

surfacenormal[hyperbolicparaboloid][u_,v_]:=
{-v, -u, 1}

surfacenormal[hyperboloid[a_,b_,c_]][u_,v_]:=
{b*c*Cos[u]*Cosh[v]^2, a*c*Cosh[v]^2*Sin[u], 
   -(a*b*Sinh[2*v])/2}

surfacenormal[kuen][u_,v_]:=
{(2*u*(2 - u^2 + u^2*Cos[2*v])*
      (-4*u*Cos[u] + 2*u*Cos[u - 2*v] + 
        2*u*Cos[u + 2*v] + 4*Sin[u] - 2*u^2*Sin[u] + 
        u^2*Sin[u - 2*v] + u^2*Sin[u + 2*v]))/
    (2 + u^2 - u^2*Cos[2*v])^3, 
   (2*u*(2 - u^2 + u^2*Cos[2*v])*
      (4*Cos[u] - 2*u^2*Cos[u] + u^2*Cos[u - 2*v] + 
        u^2*Cos[u + 2*v] + 4*u*Sin[u] - 
        2*u*Sin[u - 2*v] - 2*u*Sin[u + 2*v]))/
    (-2 - u^2 + u^2*Cos[2*v])^3, 
   (8*u^2*(2 - u^2 + u^2*Cos[2*v])*Sin[2*v])/
    (-2 - u^2 + u^2*Cos[2*v])^3}

surfacenormal[kuentcheb[a_]][u_,v_]:=
{(4*a^2*u*Cosh[v]*(1 - 2*u^2 + Cosh[2*v])*
      (-4*u*Cos[u] + Sin[u] - 2*u^2*Sin[u] + 
        Cosh[2*v]*Sin[u]))/(1 + 2*u^2 + Cosh[2*v])^3, 
   (4*a^2*u*Cosh[v]*(-1 + 2*u^2 - Cosh[2*v])*
      (Cos[u] - 2*u^2*Cos[u] + Cos[u]*Cosh[2*v] + 
        4*u*Sin[u]))/(1 + 2*u^2 + Cosh[2*v])^3, 
   (8*a^2*u^2*(1 - 2*u^2 + Cosh[2*v])*Sinh[2*v])/
    (1 + 2*u^2 + Cosh[2*v])^3}

surfacenormal[menn[a_]][u_,v_]:=
{-4*a*u^3 - 2*u*v, -u^2 + 2*v, 1}

surfacenormal[mercatorellipsoid[a_,b_,c_]][u_,v_]:=
{b*c*Cos[u]*Sech[v]^3, a*c*Sech[v]^3*Sin[u], 
   a*b*Sech[v]^2*Tanh[v]}

surfacenormal[moebiusstrip[a_]][u_,v_]:=
{(a^2*(-(v*Cos[u/2]) + 2*Cos[u] + v*Cos[(3*u)/2])*
      Sin[u/2])/2, (a^2*
      (v + 2*Cos[u/2] + 2*v*Cos[u] - 2*Cos[(3*u)/2] - 
        v*Cos[2*u]))/4, -(a^2*Cos[u/2]*(1 + v*Cos[u/2]))}

surfacenormal[monge[h_]][u_,v_]:=
{-Derivative[1, 0][h][u, v], -Derivative[0, 1][h][u, v], 1}

surfacenormal[mongepolar[g_]][r_,theta_]:=
{Sin[theta]*Derivative[0, 1][g][r, theta] - 
   r*Cos[theta]*Derivative[1, 0][g][r, theta], 
  -(Cos[theta]*Derivative[0, 1][g][r, theta]) - 
   r*Sin[theta]*Derivative[1, 0][g][r, theta], r}

surfacenormal[monkeysaddle][u_,v_]:=
{3*(-u^2 + v^2), 6*u*v, 1}

surfacenormal[paraboloid[a_,b_,c_]][u_,v_]:=
{-2*a*u - c*v, -(c*u) - 2*b*v, 1}

surfacenormal[plucker][u_,v_]:=
{(v*(u^2 - v^2))/(u^2 + v^2)^2, 
   (u*(-u^2 + v^2))/(u^2 + v^2)^2, 1}

surfacenormal[pluckerpolar[n_]][r_,theta_]:=
{n*Cos[n*theta]*Sin[theta], 
   -(n*Cos[theta]*Cos[n*theta]), r}


surfacenormal[pluckerpolar[m_,n_]][r_,theta_]:=
{n*r^m*Cos[n*theta]*Sin[theta] - 
    m*r^m*Cos[theta]*Sin[n*theta], 
   -(n*r^m*Cos[theta]*Cos[n*theta]) - 
    m*r^m*Sin[theta]*Sin[n*theta], r}

surfacenormal[pseudocrosscap][u_,v_]:=
{2*(-1 + u^2)*Cos[2*v], (1 - u^2)*Cos[v], 
   4*u*(1 - u^2)*Sin[v]^3}

surfacenormal[pseudosphere[a_]][u_,v_]:=
{a^2*Cos[u]*Cos[v]^2, a^2*Cos[v]^2*Sin[u], 
   -(a^2*Sin[2*v])/2}

surfacenormal[pstcheb[a_]][u_,v_]:=
{-(a^2*Cos[v]*Sech[u]*Tanh[u]^2), 
   -(a^2*Sech[u]*Sin[v]*Tanh[u]^2), 
   -(a^2*Sech[u]^2*Tanh[u])}

surfacenormal[richmondpolar[n_][t_]][r_,theta_]:=
{(r^(-2 + n)*(1 + r^(2 + 2*n))*Cos[(1 + n)*theta])/2, 
   (r^(-2 + n)*(1 + r^(2 + 2*n))*Sin[(1 + n)*theta])/2, 
   -1/(4*r^3) + r^(1 + 4*n)/4}

surfacenormal[roman[a_]][u_,v_]:=
{(a^4*Sin[4*v])/4, -(a^4*Cos[u]*Cos[2*u]*Cos[v]^2*
       Cos[2*v]) + (a^4*Cos[u]*Sin[u]^2*Sin[2*v]^2)/2, 
   a^4*Cos[2*u]*Cos[v]^2*Cos[2*v]*Sin[u] + 
    (a^4*Cos[u]^2*Sin[u]*Sin[2*v]^2)/2}

surfacenormal[scherk[a_]][u_,v_]:=
{-Tan[a*u], Tan[a*v], 1}

surfacenormal[scherk5][u_,v_]:=
{-(v/((1 + v^2)^(1/2)*(1 - u^2*v^2)^(1/2))), 
   -(u/((1 + u^2)^(1/2)*(1 - u^2*v^2)^(1/2))), 
   1/((1 + u^2)^(1/2)*(1 + v^2)^(1/2))}

surfacenormal[shoe][u_,v_]:=
{-u^2, v, 1}

surfacenormal[sphere[a_]][u_,v_]:=
{a^2*Cos[u]*Cos[v]^2, a^2*Cos[v]^2*Sin[u], 
   (a^2*Sin[2*v])/2}

surfacenormal[stereographicellipsoid[a_,b_,c_]][u_,v_]:=
{(-8*b*c*u)/(1 + u^2 + v^2)^3, 
   (-8*a*c*v)/(1 + u^2 + v^2)^3, 
   (4*a*b*(1 - u^2 - v^2))/(1 + u^2 + v^2)^3}

surfacenormal[swallowtail][u_,v_]:=
{2*(u + 6*v^2), 2*v*(u + 6*v^2), 2*v^2*(u + 6*v^2)}

surfacenormal[thomsen[a_,b_]][u_,v_]:=
{-(((b*Cos[a*v] + (1 + b^2)^(1/2)*Cosh[a*u])*Sin[a*v])/
      a^2), -(((b*Cos[a*v] + (1 + b^2)^(1/2)*Cosh[a*u])*
        Sinh[a*u])/a^2), 
   (((1 + b^2)^(1/2) + b*Cos[a*v]*Cosh[a*u])*
       (b + (1 + b^2)^(1/2)*Cos[a*v]*Cosh[a*u]))/a^2 + 
    (b*(1 + b^2)^(1/2)*Sin[a*v]^2*Sinh[a*u]^2)/a^2}

surfacenormal[torus[a_,b_,c_]][u_,v_]:=
{c*Cos[u]*Cos[v]*(a + b*Cos[v]), 
   c*Cos[v]*(a + b*Cos[v])*Sin[u], 
   b*(a + b*Cos[v])*Sin[v]}

surfacenormal[twiflat[pm_,a_,c_][sl_]][u_,v_]:=
{v*(-(c^2/(a*(1 - c^2/(a^2*v^2))^(1/2)*v^2)) + 
       (a^2*pm*v)/(-c^2 + a^2*v^2)^(1/2))*Cos[u] - 
    sl*Sin[u], sl*Cos[u] + 
    v*(-(c^2/(a*(1 - c^2/(a^2*v^2))^(1/2)*v^2)) + 
       (a^2*pm*v)/(-c^2 + a^2*v^2)^(1/2))*Sin[u], -v}

surfacenormal[twisphere[a_,b_]][u_,v_]:=
{a^2*Cos[u]*Cos[v]^2 + a*b*Sin[u]*Sin[v], 
   a^2*Cos[v]^2*Sin[u] - a*b*Cos[u]*Sin[v], 
   (a^2*Sin[2*v])/2}

surfacenormal[wallis[a_,b_,c_]][u_,v_]:=
{-((b^2*c*Cos[u]*Sin[u]^2)/(a^2 - b^2*Cos[u]^2)^(1/2)), 
   (b^2*c*Cos[u]^2*Sin[u])/(a^2 - b^2*Cos[u]^2)^(1/2), 
   -v}

surfacenormal[whitneyumbrella][u_,v_]:=
{2*v, -2*v^2, -u}

surfacenormal[wrinkles[a_]][u_,v_]:=
{-(a*(v^(-1) - v/u^2)), -(a*(u^(-1) - u/v^2)), 1}


(*
EndPackage[]
*)
