(* Copyright 1993 Alfred Gray *)

BeginPackage["SURFS`"]

    astell::usage="{u,v}->astell[a,b,c][u,v] is an astroidial
ellipsoid with axes of lengths a, b and c."

    bohdom::usage="bohdom[a,b,c][u,v] is a Bohemian dome.  It is formed by
moving an ellipse along another circle so that the ellipse remains
parallel to a plane."

    catalan::usage="{u,v}->catalan[u,v] is Catalan's minimal
surface."

    catalandef::usage="{u,v}->catalandef[t][u,v] is a 1-parameter family of
minimal surfaces connecting Catalan's minimal surface to its conjugate."

    catenoid::usage="{u,v}->catenoid[c][u,v] is the minimal surface
formed by revolving a catenary."

    circularcone::usage="{u,v}->circularcone[a,b][u,v] is a circular
cone of radius a and slope b/a."

    circularcylinder::usage="{u,v}->circularcylinder[a][u,v] is a circular
cylinder of radius a."

    clothmin::usage="{u,v}->clothmin[a][t][u,v] is a 1-parameter family of
minimal surfaces such that {u,v}->clothmin[a][0][u,v] is a minimal surface
containing a clothoid as a geodesic."

    cnccosurfrev::usage="{u,v}->cnccosurfrev[a,b][u,v] is a surface of
revolution of constant negative curvature a^-2 of conic type."

    cnchysurfrev::usage="{u,v}->cnchysurfrev[a,b][u,v] is a surface of
revolution of constant negative curvature a^-2 of hyperbolic type."

    cpcsurfrev::usage="{u,v}->cpcsurfrev[a,b][u,v] is a surface of revolution
of constant positive curvature a^-2.  There are 3 case:
football type (a>b), sphere (a=b), barrel type (a<b)."

    crosscap::usage="{u,v}->crosscap[a][u,v] is a parametrization of a cross
cap in R^3."

    dini::usage="{u,v}->dini[a,b][u,v] is standard parametrization of
Dini's surface of constant negative curvature -a^-2.  It is the
generalized helicoid of slant b constructed from a tractrix.
The case b=0 is the standard parametrization of a pseudosphere."

    dinitcheb::usage="{u,v}->dinitcheb[a,b][u,v] is a Tchebyshef
principal patch for Dini's surface of constant negative curvature a^-2."

    ducyc::usage="{u,v}->ducyc[{p1,p2,p3},rho,a,b][u,v] is the
cyclide of Dupin with respect to a sphere of radius rho centered at
{p1,p2,p3}."

    eightsurface::usage="{u,v}->eightsurface[u,v] is the surface formed
by revolving a figure eight."

    ellcat::usage="{u,v}->ellcat[a,b][t][u,v] is a 1-parameter family
of minimal surfaces such that {u,v}->ellcat[a,b][0][u,v]
is an elliptical catenoid and {u,v}->ellcat[a,b][Pi/2][u,v]
is an elliptical helicoid. The patch {u,v}->ellcat[a,b][0][u,v] contains
the ellipse t->ellipse[a,b][t] as a geodesic."

    ellipticcoor::usage="{u,v,w}->ellipticcoor[d,e,f][a,b,c][w][u,v] is
elliptic coordinate patch on R^3. The parameters d, e and f are
plus 1 or minus 1."

    ellipticalhyperboloidplus::usage=
"{u,v}->ellipticalhyperboloidplus[a,b,c][u,v]
is a parametrization of a hyperboloid of one sheet as a ruled surface."

    ellipticalhyperboloidminus::usage=
"{u,v}->ellipticalhyperboloidminus[a,b,c][u,v]
is a parametrization of a hyperboloid of one sheet as a ruled surface."

    ellipsoid::usage="{u,v}->ellipsoid[a,b,c][u,v] is an ellipsoid with
axes of lengths a, b and c. {u,v}->ellipsoid[a,c][u,v] is an ellipsoid with
axes of lengths a, a and c."

    enneper::usage="{u,v}->enneper[u,v] is Enneper's minimal surface.
{u,v}->enneper[n][u,v] is Enneper's minimal surface of degree n.
z->enneper[n][z] is the n-tuple of analytic function whose real part is
Enneper's minimal surface of degree n."

    ftorus::usage="{u,v}->ftorus[a,b][u,v] is a parametrization of a torus
into R^4 as the product of two circles.  {u,v}->ftorus[a,b,c,d][u,v]} is a
parametrization of an elliptical torus into R^4 as the product of two ellipses.
The Gaussian curvature is zero."

    funnel::usage="{u,v}->funnel[1,1,c][u,v] is the surface of revolution
formed by rotating the graph of t->c*Log[t]."

    genhypparab::usage="{u,v}->genhypparab[a,b][u,v] is a
parametrization of a hyperbolic paraboloid as a ruled surface."

    handkerchief::usage="{u,v}->handkerchief[a][u,v] is a handkerchief
shaped surface."

    helicoid::usage="{u,v}->helicoid[a,c][u,v] is the
standard parametrization of a circular helicoid
of radius a and slant c.  {u,v}->helicoid[a,b,c][u,v] is
the standard parametrization of an elliptical helicoid of slant c."

    helicoid1::usage="{u,v}->helicoid1[a,c][u,v] is a circular helicoid
of radius a and slant c.  {u,v}->helicoid1[a,b,c][u,v] is an elliptical
helicoid of slant c. helicoid1 is a reparametrization of helicoid."

    helicoidprin::usage="{u,v}->helicoidprin[a,b][u,v] is a
parametrization of a circular helicoid of radius a and slant c
by principal curves."

    heltocat::usage="{u,v}->heltocat[t][u,v] is a 1-parameter family of
minimal surfaces connecting the helicoid to the catenoid."

    henneberg::usage="{u,v}->henneberg[u,v] is Henneberg's minimal
surface."

    hyperbolicparaboloid::usage="{u,v}->hyperbolicparaboloid[u,v] is a
hyperbolic paraboloid."

    hyperboloid::usage="{u,v}->hyperboloid[a,c][u,v] is the 
standard parametrization of a circular hyperboloid of one sheet.  {u,v}->hyperboloid[a,b,c][u,v] is the standard parametrization of an
elliptical hyperboloid of one sheet."

    hy2sheet::usage="{u,v}->hy2sheet[a,c][u,v] is the standard parametrization of a circular hyperboloid of two sheets. {u,v}->hy2sheet[a,b,c][u,v] is the standard parametrization an elliptical hyperboloid of two sheets."

    kleinbottle::usage="{u,v}->kleinbottle[a][u,v] is the surface
formed by moving and twisting a figure eight along a circle of radius a."

    klein4::usage="{u,v}->klein4[a,b][u,v] is a parametrization of a
Klein bottle into R^4."

    kuen::usage="{u,v}->kuen[u,v] is Kuen's surface.  It has constant negative
curvature -1."

    menn::usage="{u,v}->menn[u,v] is Menn's surface."

    mercatorellipsoid::usage="{u,v}->mercatorellipsoid[a,b,c][u,v] is
the Mercator injection of an ellipsoid with axes of lengths
a, b, and c into R^3."

    moebiusstrip::usage="moebiusstrip[a][u,v] is a parametrization of a
Moebius strip."

    monkeysaddle::usage="monkeysaddle[u,v] is is a parametrization of
a monkey saddle."

    monkey::usage="monkey[n][u,v] is a parametrization of a monkey saddle
for a monkey with n-2 tails."
    
    ellipticparaboloid::usage="{u,v}->ellipticparaboloid[a,b][u,v] is
an elliptic paraboloid."

    paraboloid::usage="{u,v}->paraboloid[a][u,v] is a circular paraboloid of
radius a.  {u,v}->paraboloid[a,b][u,v] and {u,v}->paraboloid[a,b,c][u,v]
are either elliptic or hyperbolic paraboloids."

    paraboliccoor::usage="{u,v,w}->paraboliccoor[d,e,f][a,b,c][w][u,v] is
a parabolic coordinate patch on R^3. The parameters d, e and f are
plus 1 or minus 1."

    perturbedms::usage="{u,v}->perturbedms[a][u,v]  is a parametrization of
a monkey saddle perturbed by a circular paraboloid."

    plane::usage="{u,v}->plane[a1,a2,b1,b2,b3][u,v] is a
parametrization of a plane in R^3."

    plucker::usage="{u,v}->plucker[u,v] is Plucker's surface.
{r,theta}->plucker[n][r,theta] is Plucker's surface with n folds in
polar coordinates."

    pseudosphere::usage="{u,v}->pseudosphere[a][u,v] is the
standard parametrization of constant negative curvature a^-2."

    pstcheb::usage="{u,v}->pstcheb[a][u,v] is a Tchebyshef principal
patch for a pseudosphere of constant negative curvature a^-2."

    pseudocrosscap::usage="{u,v}->pseudocrosscap[u,v] is a
parametrization of a pseudo cross cap in R^3."

    rconoid::usage="{u,v}->rconoid[u,v] is a right conoid.  It coincides with
{u,v}->2*plucker[1][v/2,u]"

    roman::usage="{u,v}->roman[a][u,v] is Steiner's Roman Surface of
radius a."

    scherk::usage="{u,v}->scherk[a][u,v] is Scherk's minimal surface.
{u,v}->scherk[a,theta][u,v] is a twisted Scherk's minimal surface of angle
theta."

     scherkalt::usage="{u,v}->scherkalt[a,theta][u,v] is a
parametrization of the twisted Scherk's minimal surface of angle theta."

    scherk5::usage="{u,v}->scherk5[a,b,c][u,v] is Scherk's fifth minimal
surface, where a, b, c are plus 1 or minus 1."

    shoe::usage="{u,v}->shoe[u,v] is a shoe shaped surface."

    sievert::usage="{u,v}->sievert[a][u,v] is Sievert's surface
of constant positive curvature a^2."

    sphere::usage="{u,v}->sphere[a][u,v] is the standard parametrization of
a sphere of radius a centered at the origin."

    stereographicellipsoid::usage="{u,v}->stereographicellipsoid[a,b,c][u,v]
is the stereographic injection of an ellipsoid with axes of lengths
a, b, and c into R^3."

    tetrahedral::usage="{u,v}->tetrahedral[m,n][A,B,C][a,b,c][u,v] is a
tetrahedral surface."

    torus::usage="{u,v}->torus[a,b][u,v] is the torus formed by revolving a
circle of radius b in the xz-plane about the z-axis along a circle of radius
a in the xy-plane.  {u,v}->torus[a,b,c][u,v] is the torus formed by revolving
an ellipse with axes of lengths b and c in the xz-plane about the z-axis along
a circle of radius a in the xy-plane." 

    twiflat::usage="{u,v}->twiflat[pm,a,c][sl][u,v] is a generalized helicoid
of zero Gaussian curvature of slant sl.  The parameter pm is plus or minus 1." 

    twisphere::usage="{u,v}->twisphere[a,b][u,v] is a generalized helicoid
formed by rotating and twisting a semicircle  It is also called a
corkscrew surface." 

    wallis::usage="{u,v}->wallis[a,b,c][u,v] is a conical edge of
Wallis."

    whitneyumbrella::usage="{u,v}->whitneyumbrella[u,v] is a Whitney
umbrella."

    wrinkles::usage="{u,v}->wrinkles[a][u,v] is the Monge patch
{u,v}->{u,v,a*(u/v + v/u}."

Begin["`Private`"]

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

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

    catalan[u_,v_]:= {u - Sin[u]*Cosh[v],
                      1 - Cos[u]*Cosh[v],
                      4*Sin[u/2]*Sinh[v/2]}

    catalandef[t_][u_,v_]:= {Cos[t]*(u - Cosh[v]*Sin[u]) + 
      Sin[t]*(v - Cos[u]*Sinh[v]), 
      Cos[t]*(1 - Cos[u]*Cosh[v]) + Sin[t]*Sin[u]*Sinh[v], 
       4*(-1 + Cos[u/2]*Cosh[v/2])*Sin[t] +
       4*Cos[t]*Sin[u/2]*Sinh[v/2]}

    
    catenoid[c_][u_,v_]:= {c*Cos[u]*Cosh[v/c],
                           c*Cosh[v/c]*Sin[u],v}

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

    circularcone[a_,b_][u_,v_]:=
        {a*Sqrt[v^2]*Cos[u],a*Sqrt[v^2]*Sin[u],b*v}

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

    clothmin[a_][t_][u_,v_]:=
      {a*Pi^(1/2)*Cos[t]*Re[FresnelS[(u + I*v)/Pi^(1/2)]] + 
       a*Pi^(1/2)*Im[FresnelS[(u + I*v)/Pi^(1/2)]]*Sin[t], 
       a*Pi^(1/2)*Cos[t]*Re[FresnelC[(u + I*v)/Pi^(1/2)]] + 
       a*Pi^(1/2)*Im[FresnelC[(u + I*v)/Pi^(1/2)]]*Sin[t], 
      -(a*v*Cos[t]) + a*u*Sin[t]}

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

    cnchysurfrev[a_,b_][u_,v_]:= {b*Cos[u]*Cosh[v/a],
                                   b*Sin[u]*Cosh[v/a], 
                           - I*a*EllipticE[I*v/a,-b^2/a^2]}

    cpcsurfrev[a_,b_][u_,v_]:= {b*Cos[u]*Cos[v/a],
                                  b*Sin[u]*Cos[v/a], 
                                  a*EllipticE[v/a,b^2/a^2]}

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

    dini[a_,b_][u_,v_]:= {a*Cos[u]*Sin[v],
                           a*Sin[u]*Sin[v],
                           a*(Cos[v] + Log[Tan[v/2]]) + b*u}
   
    dinitcheb[a_,b_][u_,v_]:=
          a*{Cos[b]*Cos[v]/Cosh[(u - v*Sin[b])/Cos[b]],
            Cos[b]*Sin[v]/Cosh[(u - v*Sin[b])/Cos[b]],
             u - Cos[b]*Tanh[(u - v*Sin[b])/Cos[b]]}

    ducyc[{p1_,p2_,p3_},rho_,a_,b_][u_,v_]:=
        {p1 + (rho^2*(-p1 + Cos[u]*(a + b*Cos[v])))/
         ((-p1 + Cos[u]*(a + b*Cos[v]))^2 + 
          (-p2 + (a + b*Cos[v])*Sin[u])^2 + 
          (-p3 + b*Sin[v])^2), 
         p2 + (rho^2*(-p2 + (a + b*Cos[v])Sin[u]))/
         ((-p1 + Cos[u]*(a + b*Cos[v]))^2 + 
          (-p2 + (a + b*Cos[v])*Sin[u])^2 + 
          (-p3 + b*Sin[v])^2), 
         p3 + (rho^2*(-p3 + b*Sin[v]))/
         ((-p1 + Cos[u]*(a + b*Cos[v]))^2 + 
          (-p2 + (a + b*Cos[v])*Sin[u])^2 + 
         (-p3 + b*Sin[v])^2)}

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

    ellcat[a_,b_][t_][u_,v_]:=
        {a*Cos[t]*Cos[u]*Cosh[v] - a*Sin[t]*Sin[u]*Sinh[v], 
         b*Cos[t]*Cosh[v]*Sin[u] + b*Cos[u]*Sin[t]*Sinh[v], 
        -(b*(Cos[t]*Im[EllipticE[u + I*v,1 - a^2/b^2]] - 
       Re[EllipticE[u + I*v,1 - a^2/b^2]]*Sin[t]))}

    ellipticcoor[d_,e_,f_][a_,b_,c_][w_][u_,v_]:=
         {d*Sqrt[(a-u)*(a-v)*(a-w)/((a-b)*(a-c))],
          e*Sqrt[(b-u)*(b-v)*(b-w)/((b-a)*(b-c))],
          f*Sqrt[(c-u)*(c-v)*(c-w)/((c-a)*(c-b))]}

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

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

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

    enneper[u_,v_]:=
        {u - u^3/3 + u*v^2,v - v^3/3 + v*u^2,u^2 - v^2}

    enneper[n_][z_]:= {z - z^(2*n+1)/(2*n+1),
        -I*(z + z^(2*n+1)/(2*n+1)),2*z^(n+1)/(n+1)}

    enneper[n_][u_,v_]:= Re[enneper[n][u + I*v]]

    ftorus[a_,b_][u_,v_]:=
              {a*Cos[u],a*Sin[u],b*Cos[v],b*Sin[v]}

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

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

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

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

    helicoid[a_,c_][u_,v_]:= {a*v*Cos[u],a*v*Sin[u],c*u}

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

    helicoid1[a_,c_][u_,v_]:=
       {a*Sinh[v]*Cos[u],a*Sinh[v]*Sin[u],c*u}

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

    helicoidprin[a_,b_][p_,q_]:=
        {b*Cos[(p + q)/2]*Sinh[(-p + q)/2], 
         b*Sin[(p + q)/2]*Sinh[(-p + q)/2],b*(p + q)/2}

    heltocat[t_][u_,v_]:=
        Cos[t]*{Sinh[v]*Sin[u],-Sinh[v]*Cos[u],u} +
        Sin[t]*{Cosh[v]*Cos[u],Cosh[v]*Sin[u],v}

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

    hyperbolicparaboloid[u_,v_]:= {u,v,u*v}

    hyperboloid[a_,c_][u_,v_]:=
         {a*Cosh[v]*Cos[u],a*Cosh[v]*Sin[u],c*Sinh[v]}

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

    hy2sheet[a_,c_][u_,v_]:=
        {a*Cosh[u]*Cosh[v],a*Sinh[u]*Cosh[v],c*Sinh[v]}

    hy2sheet[a_,b_,c_][u_,v_]:=
        {a*Cosh[u]*Cosh[v],b*Sinh[u]*Cosh[v],c*Sinh[v]}

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

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

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

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

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

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

    moebiusstrip[a_][u_,v_]:= a*{Cos[u] + v*Cos[u/2]*Cos[u],
        Sin[u] + v*Cos[u/2]*Sin[u],v*Sin[u/2]}

    monkeysaddle[u_,v_]:= {u,v,u^3 - 3*u*v^2}

    monkey[n_][u_,v_]:= {u,v,Re[(u + I*v)^n]}

    ellipticparaboloid[a_,b_][u_,v_]:=
         {u,v,u^2/a^2+v^2/b^2}

    paraboloid[a_][u_,v_]:= {u,v,a*(u^2 + v^2)}

    paraboloid[a_,b_][u_,v_]:= {u,v,a*u^2 + b*v^2}

    paraboloid[a_,b_,c_][u_,v_]:= {u,v,a*u^2 + b*v^2 + c*u*v}

    paraboliccoor[d_,e_,f_][a_,b_,c_][w_][u_,v_]:=
         {d*Sqrt[(a - u)*(a - v)*(a - w)/(b - a)],
          e*Sqrt[(b - u)*(b - v)*(b - w)/(a - b)],
          f*(c - a - b + u + v + w)/2}

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

    plane[a1_,a2_,b1_,b2_,c1_,c2_][u_,v_]:=
        {a1*u + a2*v,b1*u + b2*v,c1*u + c2*v}

    plucker[u_,v_]:= {u,v,u*v/(u^2 + v^2)}
    
    plucker[n_][r_,theta_]:=
        {r*Cos[theta],r*Sin[theta],Sin[n*theta]}

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

    pseudosphere[a_][u_,v_]:= a*{Cos[u]*Sin[v],
                Sin[u]*Sin[v],Cos[v] + Log[Tan[v/2]]}

    pstcheb[a_][u_,v_]:= a*{Cos[v]/Cosh[u],
                    Sin[v]/Cosh[u],u - Tanh[u]}

    rconoid[u_,v_]:= {v*Cos[u],v*Sin[u],2*Sin[u]}

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

    roman[n_,a_][u_,v_]:= {(a^2*Cos[u]*Cos[v]^2*Sin[u])^n, 
     (a^2*Cos[v]*Sin[u]*Sin[v])^n, 
     (a^2*Cos[u]*Cos[v]*Sin[v])^n}

    scherk[a_][u_,v_]:= {u,v,(1/a)*Log[Cos[a*v]/Cos[a*u]]}

    scherk[a_,theta_][u_,v_]:=
        {Sec[2theta]*(Cos[theta]*u + Sin[theta]*v),
         Sec[2theta]*(Sin[theta]*u + Cos[theta]*v),
         (1/a)*Log[
         Cos[a*Sec[2*theta]*(Sin[theta]*u + Cos[theta]*v)]/
         Cos[a*Sec[2*theta]*(Cos[theta]*u + Sin[theta]*v)]]}

    scherkalt[a_,theta_][u_,v_]:= a*{Cos[theta]*ArcTan[u],
                   Sin[theta]*ArcTan[v],ArcTanh[u*v]} 
   
    scherk5[u_,v_]:= {ArcSinh[u],ArcSinh[v],ArcSin[u*v]}

    scherk5[a_,b_,c_][u_,v_]:=
           {a*ArcSinh[u],b*ArcSinh[v],c*ArcSin[u*v]}

    shoe[u_,v_]:= {u,v,(1/3)*u^3 - (1/2)*v^2} 

    sievert[a_][u_,v_]:=
       {2/(a + 1 - a*Sin[v]^2*Cos[u]^2)*
        (Sqrt[(a + 1)*(1 + a*Sin[u]^2)]*Sin[v]/Sqrt[a])*
         Cos[-u/Sqrt[a + 1] + ArcTan[Sqrt[a + 1]*Tan[u]]],
         2/(a + 1 - a*Sin[v]^2*Cos[u]^2)*
         (Sqrt[(a + 1)*(1 + a*Sin[u]^2)]*Sin[v]/Sqrt[a])*
         Sin[-u/Sqrt[a + 1] + ArcTan[Sqrt[a + 1]*Tan[u]]],
         (Log[Tan[v/2]]+
         2*(a + 1)/(a + 1 - a*Sin[v]^2*Cos[u]^2)*
         Cos[v])/Sqrt[a]}

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

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

    tetrahedral[m_,n_][A_,B_,C_,a_,b_,c_][u_,v_]:=
              {A*(u - a)^m*(v - a)^n,
               B*(u - b)^m*(v - b)^n,
               C*(u - c)^m*(v-c)^n}

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

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

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

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

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

    twisphere[a_,b_][u_,v_]:=
        {a*Cos[u]*Cos[v],a*Sin[u]*Cos[v],a*Sin[v] + b*u}

    wallis[a_,b_,c_][u_,v_]:= {v*Cos[u],v*Sin[u],
                      c*Sqrt[a^2 - b^2*Cos[u]^2]}
 
    whitneyumbrella[u_,v_]:= {u*v,u,v^2}

    wrinkles[a_][u_,v_]:= {u,v,a*(u/v + v/u)}
End[]

EndPackage[]
