This page contain some of the details conected to Algebraic Surfaces drawing program.
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.
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.
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.
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.
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.
Here are some example definitions you can try.
These are taken from a clasification of degenerate points, see Singularities of Maps from R^3 to R for a bit more explination.
Type | Normal form | Alternate 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.
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.
-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 + xf will have a repeated root when f=0 and df/dX = 0. Now
df/dX = 4 t^3 + 2 z t + ysolving 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 = 0so 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 = 0as 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^2this 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^2i.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.
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.
x^2 + y^2 + z^2 = 1;
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.
x y z = 0;
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;
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;
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.
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.
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.
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.
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.
On other systems you will need to download all three. Email me for details on how to set up.