Examples of algebraic surfaces

This page contain some of the details conected to Algebraic Surfaces drawing program.

Syntax of Definitions

The basic syntax is quite simple: the formula should involve x y and z and should be an implicit polynomial equation:
   some polynomial function of x, y, z = 0;
A semi colon is needed at the end of the equation. x^2 means x squared. For example
    x^2 - y^2 - z^2 = 0;
Theres no need to include a * between terms to be multiplied. only a space is needed. For example x y is the same a x*y. Theres quite a few more sophisticated features of the syntax which will appear below soon.

Multi-line equations can be used. All the equations after the first will be substituted into the first equation. For example

x^2 - w = 0; w = y^2 + z^2;
is equivilent to the equation given above.

Some example definitions are listed below.

Region of interest

These parameters control the range over which the surface is calculated. Its best if unequal values are chosen for the ranges. Otherwise cetrain degeneracies may occur which can lead to poorer results.

Resolution control

These parameters control how detailed the resulting mesh will be. Each of these must be a power of two. The box specified by the range is split into a number of smaller boxes and points of the faces of these boxes will be found together with any singularities lying in the middle of them. The Coarse parameter specifies the number of smaller boxes, by default 8 along the x, y, z directions, i.e. 512 boxes. The Fine parameter specifies the smallest box size used to find a singularity. The Face specifies how accurately each face of the box is subdivided and the edge parameter specifies how accuratly each edge is subdivided.

Generally you will just want to change the Coarse parameter. If the singularities are not calculated very well then you could also increase the Fine parameter. Lowering the other parameters may give quicker results. Not much will be gained by increasing them. As a rule you should keep Coarse < Fine < Face < Edge or the results will be unpredictable.

Timeout

If a degenerate surface is specified the program can take a very long time to run. To prevent this from happening the cgi program will timeout after a certain time. This may mean the surface will not be calculated properly. If you want to calculate more complicated surfaces please email me at pfaf@webmaster.org and I'll provide a version you can run at home which does not have the timeout restiction.

Draw Degenerate lines

Some surfaces such as the cross cap x^2 y + z^2 = 0; can contain degenerate lines, and isolated points as well as surface you normally expect. By default the drawing of these lines and points is switced off, clicking on the Draw Degenerate lines switches the drawing of these on. Note that when this option is on two aditional geometries will be created, these are called something like asurf lines and asurf points will be created.

Create New Geoms

Normally the new geometry created will replace the exsisting one. Howver you might want to draw a sequence of surfaces, eg level sets of f(x,y,z)=a for different values of a. If this is option is on a gew geometry will be created each time, the names will be like asurf {1}, asurf {2}.

Draw in Colour

By default the surface will be coloured according to the x,y,z values of individual points. This can be switched off by deslecting this option. The surface will be a uniform light blue colour. This can be useful if you want to colour different surfaces different colours by using the material panels.

Keep material props

By default the surface will be drawn with faces(elements) visible, edges, lines and verticies not visable. If you want to keep the existing properties (say edges visable) then select this option.

Examples

Here are some example definitions you can try.

The different types of singularities which can appear

These are taken from a clasification of degenerate points, see Singularities of Maps from R^3 to R for a bit more explination.

TypeNormal formAlternate forms
A0 (not singular) x - y^2 - z^2; x + y^2 - z^2;
A1 x^2 - y^2 - z^2; x^2 + y^2 + z^2; (isolated point)
A2 x^3 - y^2 - z^2; x^3 + y^2 - z^2;
A3 x^4 - y^2 - z^2; x^4 + y^2 - z^2;
x^4 + y^2 + z^2; (isolated point)
A4 x^5 - y^2 - z^2; x^5 + y^2 - z^2;
D4 x^2 y - y^3 - z^2; x^2 y + y^3 - z^2;
D5 x^2 y - y^4 - z^2; x^2 y + y^4 - z^2;
D6 x^2 y - y^5 - z^2; x^2 y + y^5 - z^2;
E6 x^3 - y^4 - z^2; x^3 + y^4 - z^2;
E7 x^3 - x y^3 - z^2;
E8 x^3 - y^5 - z^2;

Then there are some highly degenerate surfaces where whole curves are singular.

Cross Cap (Whitney Umberella)
x^2 y - z^2 = 0;
Considered as a map from R^2 to R^3 the cross cap This differs from a cross cap (a parametrised surface) because it has a handle along the line x = z = 0. You will find cross caps present in many famous algebraic surface, for example Steiners Roman surface contains 4.
A Swallowtail surface
-4 z^3 y^2 - 27 y^4 + 16 x z^4 -128 x^2 z^2 + 144 x y^2 z + 256 x^3 = 0;
This surface is an example of a discriminate surface. Consider the polynomial
	f = t^4 + z t^2 + y t + x
f will have a repeated root when f=0 and df/dX = 0. Now
	df/dX = 4 t^3 + 2 z t + y
solving this pair of equations for t gives
4 z^3 y^2 - 27 y^4 + 16 x z^4 -128 x^2 z^2 - 144 x y^2 z + 256 x^3 = 0
so the surface of the swallowtail gives the set of values of x,y,z where f has a repeated root. There a several special curves on this surface. If
	d^2f/dX^2 = 12 t^2 + 2 z = 0
as well then f has a triple root, this hapens when
	x = - (t^4 + z t^2 + y t);
	y = - (4 t^3 + 2 z t);
	z = - 6 t^2
this curve lies along the cuspidal edge of the surface.

The polynomial with have two repeated roots if it can be written as

	f = (t^2 - a)^2
	f = t^4 - 2 a t^2 + a^2
i.e. if x = a^2, y = 0, z = - 2 a, i.e. if 4 x = z^2, y = 0. If z > 0 this coresponds to two repeted real roots (the self intersection of the surface) and if z < 0 then it gives two complex repeated roots (a tail shown on the surface).

Finally if x = y = z then the polynomial is just t^4 which has a four times repeated root for t = 0.

Deformations of surfaces

The reason why the above singularities are important is that when you have a family of surfaces controled a a number of parameters you will often find some surfaces which contain one of these singularities. For example consider the one parameter family of surfaces:

x^2 - y^2 - z^2 = a; 

for each different value of a you get a different surface. When a < 0 you get a hyperboloid of one sheet and when a > 0 you get a hyperboloid of two sheets. When a = 0 you get a surface which contains an A1 singularity. Try using the equation

x^2 - y^2 - z^2 = a;
a = 0.1;

with a taking the values 0.1, 0.05, 0, -0.05, -0.1. In a one parameter family you typically only get A1 singularities either of the type show above or its alternate form. The alternate form is just an isolated point, which occurs in the family

x^2 + y^2 + z^2 = a;

Lots of fun can be had by taking one of the more complicated singularities such as D4 and adding lower degree terms for example try

x^2 y - y^3 - z^2 + a x^2 + b y^2 + c (x^2-y^2) + d y z = 0;
a = 0.0;
b = 0.0;
c = 0.0;
d = 0.0;

And vary the values of a, b, c, d. When a and b are non zero you get surfaces which show A2 singularities. Perhaps the most fun is had whne the value of c is changed and a surfaces with three A1 points is displayed.

Another deformation to try is to take the D5 and add on multiples of y^3

x^2 y + y^4 - z^2 + a y^3 = 0;
a = -0.5;

You can do the same trick with the other forms of D4 and D5 as well as any of the other higher singularities.

A collection of other surfaces

A sphere
x^2 + y^2 + z^2 = 1;
A squared off sphere
x^4 + y^4 + z^4 = 1;
A generalisation of a sphere, the square havebeen replaced by higher powers. Try increasing the powers to get nearer to a cube.
Three planes
x y z = 0;
Cayley's cubic
4 (x^2+y^2+z^2) + 16 x y z = 1;

Working in complex projective 3 space there is only one cubic with 4 singular points (up to isomorphism), which is called Cayley's cubic. An equation for this is

      4(x^3+y^3+z^3+w^3)-(x+y+z+w)^3=0;
    
In real 3D space the other versions can look very different, try:
4(x^3+y^3+z^3+w^3)-(x+y+z+w)^3=0; w = 1;
or
-5(x^2*y+x^2*z+y^2*x+y^2*z+z^2*y+z^2*x)+2*(x*y+x*z+y*z)=0; 
A sextic surface with 65 singularities
4 ( t^2 x^2 - y^2 ) ( t^2 y^2 - z^2 ) ( t^2 z^2 - x^2 ) - ( 1 + 2 t) (x^2 + y^2 + z^2 - 1)^2 = 0;
t = 1.618034;
(The second equation defines the value of tau, the golden ratio). (use +/-2 for the domain bounds)
Steiners Roman Surface
x^2 y^2 + y^2 z^2 + z^2 x^2 = 2 x y z ;
Kummer surface
(3-v^2) ( x^2+y^2 + z^2 - v^2)^2 - (3 v^2 - 1) p q r s = 0;
p = 1 - z - x rt2;
q = 1 - z + x rt2;
r = 1 + z + y rt2;
s = 1 + z - y rt2;
v = 1.1;
rt2 = sqrt(2);
(You can vary the value of v to get different surfaces, try v=1, 1.1, 1.5, 1.7, 1.8, 2. Note the similarity with the roman surface).
Dupin Cyclides
This is a family of quartic surfaces which are generalisation of a torus.
(r1^2 - dy^2 - (dx + r0)^2) (r1^2 - dy^2 - (dx - r0)^2)*
(x^4+y^4+z^4)+ 2((r1^2 - dy^2 - (dx + r0)^2 )*
(r1^2 - dy^2 - (dx - r0)^2) (x^2 y^2+x^2 z^2+y^2 z^2))+
2 ri^2 ((-dy^2-dx^2+r1^2+r0^2) (2 x dx+2 y dy-ri^2)-4 dy r0^2 y)*
(x^2+y^2+z^2)+ 4 ri^4(dx x+dy y) (-ri^2+dy y+dx x)+
4 ri^4 r0^2 y^2+ri^8=0;
r0=2.1;r1=2;dx=2;dy=0;ri=2;
Use +-5 for domain limits.

Where
r0=Major radius of generating Torus.
r1=Minor radius of generating Torus.
dx,dy=Torus displacement.
ri=Inversion radius.
Other examples to try:
r0=1.9;r1=2;dx=2;dy=0;ri=2;
r0=2;r1=2;dx=2;dy=0;ri=2;
r0=2.1;r1=2;dx=2;dy=0;ri=2;
r0=4;r1=2;dx=2;dy=0;ri=2;
r0=4.5;r1=2;dx=2;dy=0;ri=2;
r0=1.1;r1=2;dx=5.5;dy=0;ri=3.0; (look at this one with edges on and elements off)
Boys surface
64 (1-z)^3 z^3- 48 (1-z)^2 z^2 (3 x^2+3 y^2+2 z^2)+
12 (1-z) z (27 (x^2+y^2)^2-24 z^2 (x^2+y^2)+
36 sqrt(2) y z (y^2-3 x^2)+4 z^4)+
(9 x^2+9 y^2-2 z^2) (-81 (x^2+y^2)^2-72 z^2 (x^2+y^2)+
108 sqrt(2) x z (x^2-3 y^2)+4 z^4)=0;
Skeleton of a cube
x^4 + y^4 + z^4 - 5 (x^2 + y^2 + z^2 ) + 11.8 = 0;
(use +/- 3 for the bounds. It looks quite nice if 12.5 is used as the constant.)
Tetrahedral skeleton
(x^2+y^2+z^2-a*k^2)^2-b*((z-k)^2-2*x^2)*((z+k)^2-2*y^2)=0;
k=5; a=0.95; b=0.8;
(Use +/- 5 for the bound).
Hunt's Surface
4 (x^2 + y^2 + z^2 - 13)(x^2 + y^2 + z^2 - 13)(x^2 + y^2 + z^2 - 13) + 27 (3 x^2 + y^2 -4 z^2 - 12)^2 = 0; (use +/- 5 for domain limits)
Some other surfaces from the hand of Cayley
a1*p1+(a2*z+a3)*p3+a4*z^3+a5*z^2+a6*z+a7=0;
p1=2*x^3-6*x*y^2;
p3=x^2+y^2;
a3=-3*a1;
a5=a2^2/(3.0*a1);
a6=-a2;
a7=a1;
a1 = -1.0;
a2 = -1.0;
a4 = 1.0;
(Use +/-2 for the domain bounds).
a1*p1+(a2*z+a3)*p3+a4*z^3+a5*z^2+a6*z+a7=0;
p1=2*x^3-6*x*y^2;
p3=x^2+y^2;
a1 = -0.8;
a2 = 0.0;
a3 = 0.0;
a4 = 1.0;
a5 = 0.8;
a6 = 0.0;
a7 = 0.0;
25*z^3+16*z*y^2+60*x^2*y+50*z^2;
p1=2*x^3-6*x*y^2;
p3=x^2+y^2;
a1=3.0;
a2=0.8;
(Use +-4 for domain bounds).
x^2+y^2+z^3+3.2*(x^3-3*x*y^2);
16*p*q*r-s^3;
p=1-z-w2*x;
q=1-z+w2*x;
r=1+z+w2*y;
s=1+z-w2*y;
w2 = 1.414214;
Kohn-Nirenberg domain
3 z + 9 z^2*b + b^4 + 15/7*b*re + a*(x^2 + y^2 + 9 z^2)^5;
b = x^2 + y^2;
re = ((x,y)*(x,y)*(x,y)*(x,y)*(x,y)*(x,y)).(1,0);
a= 0.0;
(use +/-3 for the domain). Try a=0, 0.3, 0.64, 1.0.
Five fold oddity.
z + ((x,y)*(x,y)*(x,y)*(x,y)*(x,y)).(1,0);
(use +/-2 for the domain). This example illustrates some more complex features of the syntax, namely the use of vectors and the fact that 2D vectors can be used as complex numbers. Hence (x,y)*(x,y) calculates the square of the complex number (x,y) and (x,y).(1,0) calculates the dot product of two vectors. Here it calculates the real part of (x,y)^5.

Other pages about Algebraic Surface

Many of the equations here have been pinched from other place on the web, have a look to see some other wonderful surface. and my own

How it works

The program consists of two part a webserver which actually calculates the points on the surface and a Java applet which displays the surface and allow interactive rotation. The webserver forms part of the LSMP program which I wrote several years back. The client side uses the JavaView package by Konrad Polthier et. al. at sfb288 in Berlin.

The algorithm for generating the surfaces is a little complicated and is fully described in my paper A new method for drawing Algebraic Surfaces. It basically works by recursive subdivision of the domain and looks for singular points to help resolve the topology. It makes heavy use of Bernstien polynomials which allow a quick test of whether a surface has a component in a particular region.

Bugs

The algorithm is far from perfect and there will always be surfaces where it does not quite calculate the geometry correctly. These typically involve higher order singularities and curves of self-intersection. Often better models of these points can be obtained by increasing the coarse and fine resolutions or by reducing the size of the domain. If you find any surfaces where it does a particular bad job let us know and I see if I can tweek the algorithm a little bit.

Download

Rather than having to be online the whole time you may want to download the programs so it can run at home. The program consist of a number of parts.

  1. Client side Java applet and win32 server includes source code. (200K)
  2. Javaview class library if you already have javaview installed then you don't need this file. Otherwise save this in the jars sub-directory. (500K)
  3. Source code for the server useful if you want to run on linux or other non PC machines. (200K)
On windows you need to download the first two files and put the second in the jars directory. Then you can run the asurfclient.bat program either from a dos command prompt or from explorer.

On other systems you will need to download all three. Email me for details on how to set up.


Web page, applet and Algebraic Surface program by Richard Morris
Maths home page Personal home page
Email pfaf@webmaster.org or rjm@amsta.leeds.ac.uk.
Copyright Jan 2001.