# Help and info

(Open in new window) A program for calculating singular algebraic curves and surfaces Standard Version, Pro Version. R Morris 1990-2003

SingSurf can draw:

Algebraic Surfaces (asurf)
Surfaces defined as the zero set of a polynomial in x,y,z e.g. a sphere x^2+y^2+z^2=1;. Detailed help Notes on examples

Other types of curves and surfaces can also be drawn using the Pro version:

Algebraic Curves (acurve)
Curves defined by a polynomial in x,y e.g. a circle x^2+y^2=1;. Detailed help Notes on examples
Algebraic Curves in 3D(acurve3)
Curves defined by two polynomials in x,y,z e.g. a conic section x^2-y^2-z^2=0; x+y+z=0.5;. Detailed help Notes on examples
Parameterised Surfaces(psurf)
Surfaces defined by a three parameterised equations in two variables. e.g. a sphere X=cos(x) cos(y); Y = cos(x) sin(y); Z = sin(x);. Detailed help Notes on examples
Parameterised Curves(pcurve)
Curves defined by a three parameterised equations in one variables. e.g. a helix X=cos(x); Y = sin(x); Z = x;. Detailed help Notes on examples
Implicit Surfaces(impsurf)
Surfaces defined as the zero set of a non-polynomial function in x,y,z. e.g. a sum of sins sin(x)+sin(y)+sin(z)=0;. Detailed help Notes on examples
Intersections of surfaces (intersect)
Finds the intersect of a surface with an implicit equation x,y,z. For example finding the intersection of a surface with the sphere x^2+y^2+z^2=1 or the the portion contain inside it. Help awaiting. For now see Release Notes.
Mappings (mapping)
applies some mapping f: R^3 -> R^3 to the geometry. Help awaiting. For now see Release Notes.
Integral Curves (icurve)
This program uses the points of the input geometry as base points for calculating the integral curves for some vector field. Help awaiting. For now see Release Notes.
Ridges, Focal Surfaces and Principal directions
These are all calculated using the Intersect, Mapping, and Icurve programs. Generic functions like Ridge are defined which are combined with the equation of the surface to produce the equation to define the Ridges for that surface. This can also be used to calculate symmetry sets an its allies.

Details of the syntax for the individual projects plus some examples definitions are shown in the individual pages. This page covers some basics usage info of the whole package.

## Main Features

When the page is first loaded the main viewing window is displayed in web browser and a new window is created. A predefined surface is loaded. The program is initially configured to calculate algebraic surfaces.

Rotating the surface

The surface displayed can be rotated by holding down the left mouse button in the window and moving it around.
Changing the definition

In the new control window the equation is displayed. This can be edited to change the definition. When you are happy with the equation press the Calculate button. The program works in a client server fashion, a request is sent to a server on the internet which calculates the surface and the geometry is returned. This can take some time, please be patient.
Predefined Surfaces

Just click on one of the pictures on the left and that surface will be loaded and calculated. For the Pro version select the definition from the list of Pre-define Surfaces Selecting one of these will load that equation. To draw the surface you will still need to press the Calculate button.
Selecting other types of curves and surfaces

(Pro version only). Initially the applet is set to calculate algebraic surfaces. To draw a different type of surface select the type you want from the New: pull down menu, just above the viewing area. This will load a new surface into the viewing window and the control panel will be loaded with panels for controlling this type of curve and surface. Its possible two have more than one project for each type of surface.
Switching between existing curves and surfaces

(Pro version only). The left hand, Existing:, pull down menu controls which of the currently defined surfaces controls panel is displayed in the control window. Switching between these will allow the equation of one of the surfaces to be displayed.
Center new object

When checked new geometries will be centered in the display. In the standard version this is always on.
Domain Control

In the control window a set of tab panels is displayed. Pressing on Domain will bring the sub panel for controlling the range over which the surface is calculated and also for the parameterised curve and surface project the number of steps used to calculate the surface.
Resolution

Selecting this panel in the control window allows various other parameters used for calculating the surface to be displayed. For the algebraic curve and surface projects the Course parameter defines how fine a mesh is used to calculate the surface.

Several other options are available in this panel:

Create New Geoms
Normally the new geometry created will replace the existing one. However you might want to draw a sequence of surfaces, e.g. level sets of f(x,y,z)=a for different values of a. If this is option is on a new geometry will be created each time, the names will be like asurf {1}, asurf {2}. Only the last of these geometries can be subsequently changed.
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 deselecting 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 visible. If you want to keep the existing properties (say edges visible) then select this option.

## Other options in the control panel

A well as specific details of curve or surface there are many other options available, other control windows can be brought into view using the Project menu. The options hear are:

• Project this brings up the surface display options mentioned above. Switch back to this to change the curve or surface definition.
• Object->Info shows the coordinates of the individual points in a given object.
• Object->Material allow the colour of the faces to be changed as well as whether edges are displayed and several other options.
• Camera controls the camera and view direction. For drawing 2D algebraic curves you might want to select the Top (X-Y) option here.
• Display at the bottom of this panel is a list of the curves and surfaces created. The left hand list shows the active geometry which is the one whose material properties can be altered. The right hand list shows which geometries are visible.

## Syntax of Definitions

The exact form of the defining equations varies between the different programs. Examples of these can be found in the help pages for the individual programs algebraic surfaces  algebraic curves  algebraic curves in 3D  parameterised surfaces  parameterised curves  implicit surfaces.

Each curve or surface will be defined by a set of equations. A semi colon is needed at the end of each equation. x^2 means x squared. There is 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. Pi can be used for 3.1415...

Algebraic Surfaces
One polynomial equation involving x y and z e.g. a sphere
`x^2+y^2+z^2=1;`
Algebraic Curves
One polynomial equation involving x and y e.g. a circle
`x^2+y^2=1;`
Algebraic Curves in 3D
Two polynomials equations involving x y and z e.g. a conic section
`x^2-y^2-z^2=0;x+y+z=0.5;`
Parameterised Surfaces
Three parameterised equations involving x and y. e.g. a sphere
`X = cos(x) cos(y);Y = cos(x) sin(y);Z = sin(x);`
Alternatively one vector equation can be used. A Vector has the form (f,g,h) where f, g, h are other formulas. For example a sphere could be written as
`(cos(x) cos(y),cos(x) sin(y),sin(x));`
Parameterised Curves
Curves defined by a three parameterised equations in one variables. e.g. a helix
`X = cos(x);Y = sin(x);Z = x;`
or in vector form
`(cos(x),sin(x),x);`
Implicit Surfaces
One non-polynomial equation x,y,z. e.g. a sum of sins
`sin(x)+sin(y)+sin(z)=0;`
Multi-line equations
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 equivalent to x^2 - y^2 - z^2=0;. In particular equations involving parameters can be used. The following gives an ellipse

`(a cos(x),b sin(x),0);a = 2;b = 1;`
Functions
A variety of functions can be used in the definitions, these are:
Trigonometric:
sin(x), cos(x), tan(x), asin(x), acos(x), atan(x), sec(x), cosec(x), cot(x).
Hyperbolic:
sinh(x), cosh(x), tanh(x), asinh(x), acosh(x), atanh(x).
Logarithmic:
ln(x), exp(x)
Other:
sqrt(x), pow(x,y), abs(x), sgn(x), max(x,y), min(x,y), if(x,y,z).

Most functions correspond to the function with the same name in the C maths library. The function sgn(x) returns -1 if x < 0; 0 if x = 0 and +1 if x > 0. The function if(x,y,z) returns y if x <= 0, and z if x > 0.

Differentiation
It is possible to include the differential operator diff(f,x) which represents the partial derivative of f with respect to x. For example the tangent developable of a curve can be written as
`f = diff(f,x) * y;f = (x^2,x^3,x^4); # equation for the curve`
Vectors

A vector is written as (a,b,c) and can be two three or four dimensional. Vectors can be added or subtracted using + and -, multiplied by a scalar (e.g. a * (b,c,d)). The dot product . and cross product ^ can also be used. For 2D vectors they can also be multiplied as if they were complex numbers.

## 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

## Awards SingSurf was selected as Knot in the Braid cool website of the week June 25 2003.

## References

There are lots of good books out there about curves and surfaces. Those specifically related to singularity theory include:

• Geometric Differentiation: for the intelligence of curves and Surfaces Ian R Porteous, Cambridge University Press. 1994.
• Solid Shape J.J. Koenderink MIT Press, 1990.
• Curves and Singularities (2nd edition) J.W. Bruce, P.J. Giblin Cambridge University Press. 1992.

I've written a few papers about the software and geometry

• A New Method for Drawing Algebraic Surfaces, R. J. Morris, in Design and Applications of Curves and Surfaces, Ed R.B. Fisher, Clarendon Press, Oxford, 1994. (online)
• Sub Parabolic Lines on Surfaces, R. J. Morris, in Mathematics of Surfaces VI, Ed. Glen Mullineux, IMA new series 58, Clarendon Press, Oxford, 1996. (online)
• The Use of Computer Graphics for Solving Problems in Singularity Theory, R. J. Morris, in Visualisation and Mathematics, Ed. Hans-Christian Hege and Konrad Polthier, Springer Verlag, 1997, pp 53-66. (online)
• A client-server system for the visualization of algebraic surfaces on the Web Richard Morris, in Algebra, Geometry, and Software Systems, Ed. Michael Joswig and Nobuki Takayama. Springer Verlag, 2003, pp 239-253.
• Slides for above talks

## 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 algebraic 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 Bernstein polynomials which allow a quick test of whether a surface has a component in a particular region. It also make special effort to find the singularities of the surface, which are places where all three partial derivatives of the function vanish.

An illustrated overview of the working of the system.

## 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 tweak 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. Please note the program is released under a Creative Commons License (Attribution, Non-Commercial, Share Alike). If you would like to use the program in a commercial package, please get in touch.

The program consist of a number of parts.

1. Client side Java applet and win32 server includes source code. (500K)
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 SingSurf.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 compile and set up the program.

If you do decide to download the applet you may like to consider a donation you can do this easily at PayPal. This would make me a happy bunny indeed.

### Out of Environment Space

If you get the above message when running the down loaded programs on a windows machine you can fix it with either of the two options

1. Right-click the MS-DOS Prompt shortcut (or the SingSurf.bat) file, and then click Properties. Click the Memory tab. In the Initial Environment box, set the initial environment size you want (from 256 to 4,096 bytes, in 256-byte increments). Click OK.
2. To increase the default environment space for all MS-DOS programs running in Windows, edit the Shell command in the Config.sys file. To do this, follow these steps:
1. Click Start, and then click Run.
2. In the Open box, type sysedit, and then click OK.
3. Click the Config.sys window.
4. At the beginning of the Shell= line, type REM, and then press the SPACEBAR.
5. If the Shell= line does not exist, proceed to the next step.
6. Press the HOME key.
7. Type the following line to create a new Shell= line, and then press ENTER: SHELL=C:\COMMAND.COM /E:4096 /P
8. On the File menu, click Save.
9. On the File menu, click Exit.
10. Restart the computer. This work is licensed under a Creative Commons License. (You can copy, distribute and display this works but: Attribution is required, its for Non-Commercial purposes, and it's Share Alike (GNUish/copyleft) i.e. has an identical license.) It would also be nice if you let me know (rich@singsurf.org) if you link to, redistribute, make a derived work or do anything groovy with this information.   