(*:Title: ISURFS *)

(*:Author: Alfred Gray *)

(* Copyright 1994  by Alfred Gray *)

(*:Package Version: 1.0 *)

(*:Mathematica Version: 2.2 *)

(*:Summary: 
	This package consists of definitions of implicitly defined surfaces.
*)

(*:Keywords:
crosscapimplicit, ellipsoidimplicit, ellipticparaboloidimplicit, 
goursatimplicit, hyperbolicparaboloidimplicit, hyperboloidimplicit, 
hy2sheetimplicit, kummerimplicit, scherkimplicit, scherk5implicit, 
sphereimplicit, torusimplicit,  twocuspsimplicit
*)

Print["For a list of implicitly defined plane curves type isurfs."]

BeginPackage["ISURFS`","ImplicitPlot3D`"]

    isurfs:=Print[Select[Names["ISURFS`*"],#!="isurfs"&]]

    crosscapimplicit::usage="crosscapimplicit[a,b][x,y,z]==0 is the 
nonparametric form of a crosscap."

    ellipsoidimplicit::usage="ellipsoidimplicit[a,b,c][x,y,z]==0 is the 
nonparametric form of an ellipsoid."

     ellipticparaboloidimplicit::usage=
"ellipticparaboloidimplicit[a,b,c][x,y,z]==0
is the nonparametric form of an ellipticparaboloid."

    goursatimplicit::usage="goursatimplicit[a,b,c][x,y,z]==0 is the 
nonparametric form of Goursat's surface."

    hyperboloidimplicit::usage="hyperboloidimplicit[a,b,c][x,y,z]==0 is the 
nonparametric form of a hyperboloid of one sheet."

    hy2sheetimplicit::usage="hy2sheetimplicit[a,b,c][x,y,z]==0 is the 
nonparametric form of a hyperboloid of two sheets."

    hyperbolicparaboloidimplicit::usage=
"hyperbolicparaboloidimplicit[a,b,c][x,y,z]==0
is the nonparametric form of a hyperbolicparaboloid."

    kummerimplicit::usage="kummerimplicit[x,y,z]==0
is the nonparametric form of Kummer's surface."

    scherk5implicit::usage="scherk5implicit[x,y,z]==0 is the nonparametric 
form of a Scherk's fifth minimal surface."

    scherkimplicit::usage="scherkimplicit[a][x,y,z]==0 is the nonparametric 
form of Scherk's minimal surface.  scherkimplicit[a,phi][x,y,z]==0 is the
nonparametric form of a twisted Scherk's minimal surface."

    sphereimplicit::usage="sphereimplicit[a][x,y,z]==0 is the nonparametric 
form of a sphere.  sphereimplicit[n,a][x,y,z]==0 is the nonparametric form
of the surface x^(2*n) + y^(2*n) +z^(2*n) = a^(2*n)."

    torusimplicit::usage="torusimplicit[a,b][x,y,z]==0 is the
nonparametric form of a torus."

    twocuspsimplicit::usage="twocuspsimplicit[x,y,z]==0 is the
nonparametric form of a surface with two cusps."

Begin["`Private`"]

    crosscapimplicit[a_,b_][x_,y_,z_]:=
        (a*x^2 +b*y^2)(x^2 + y^2 + z^2) -2*z*(x^2 + y^2)

    ellipsoidimplicit[a_,b_,c_][x_,y_,z_]:=
               (x/a)^2 + (y/b)^2 + (z/c)^2 - 1

    ellipticparaboloidimplicit[a_,b_,c_][x_,y_,z_]:=
               (x/a)^2 + (y/b)^2 - c*z

    goursatimplicit[a_,b_,c_][x_,y_,z_]:= x^4 + y^4 + z^4 +
                   a*(x^2 + y^2 + z^2)^2 + b*(x^2 + y^2 + z^2) + c

    hyperboloidimplicit[a_,b_,c_][x_,y_,z_]:=
               (x/a)^2 + (y/b)^2 - (z/c)^2 - 1

    hy2sheetimplicit[a_,b_,c_][x_,y_,z_]:=
               (x/a)^2 - (y/b)^2 - (z/c)^2 - 1

    
    hyperbolicparaboloidimplicit[a_,b_,c_][x_,y_,z_]:=
               (x/a)^2 - (y/b)^2 - c*z

    kummerimplicit[x_,y_,z_]:= x^4 + y^4 + z^4 -
             (y^2*z^2 + z^2*x^2 + x^2*y^2) - (x^2 + y^2 + z^2) + 1

    scherk5implicit[x_,y_,z_]:=
               Sinh[x]*Sinh[y] - Sin[z]

    scherkimplicit[a_][x_,y_,z_]:=
               E^(a*z)*Cos[a*x] -  Cos[a*y]

    scherkimplicit[a_,phi_][x_,y_,z_]:=
               Tan[x/(a*Cos[phi])]*Tan[y/(a*Sin[phi])] - Tanh[z/a]

    sphereimplicit[a_][x_,y_,z_]:=
               x^2 + y^2 + z^2 - a^2

    sphereimplicit[n_,a_][x_,y_,z_]:=
               x^(2*n) + y^(2*n) + z^(2*n) - a^(2*n)

    torusimplicit[a_,b_][x_,y_,z_]:=
              z^2 + (Sqrt[x^2+y^2] - a)^2 - b^2

    twocuspsimplicit[x_,y_,z_]:= (z -1)^2*(x^2 - z^2) -
           (x^2 - z)^2 - y^4 - y^2*(2x^2 + z^2 + 2*z -1)

End[]

EndPackage[]

