 # Examples of implicit surfaces

For details of the basic operation of the program see the Main Help page. Some special options specific to the calculation of algebraic surfaces is below. Example definitions plus some explanation are also 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 certain 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 accurately 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 rich@singsurf.org and I'll provide a version you can run at home which does not have the timeout restriction.

## Examples

Below are various examples of implicit surfaces, further examples can be found in the Algebraic Surface help page, but better results will be produced for polynomial function if the Algebraic Surface project is used instead. All the examples (except the super-ellipse) come from The Scientific Graphics Project.

Sum of Sins
`sin(x) + sin(y) + sin(z) = 0;`
super-ellipse
```(abs((A - x)/a)^(2/e)
+ (abs(B - y)/b)^(2/e))^(e/f)
+ (abs(C - z)/c)^(2/f) = 1;
A = 0.0; B = 0.0; C = 0.0;
a = 0.75429300; b = 0.75429300; c = 2.07894000; e = 0.38533800;  f = 0.09582500;
```
A generalisation of an ellipse. Set timeout to 100 and Course to 16 to get a good image.

P (Schwarz P)
`cos(x) +  cos(y) +  cos(z) = 0;`
D (Diamond)
```sin(x) sin(y) sin(z) +
sin(x) * cos(y) * cos(z) +
cos(x) * sin(y) * cos(z) +
cos(x) * cos(y) * sin(z) = 0;```
G (Gyroid)
```cos(x) * sin(y) +
cos(y) * sin(z) +
cos(z) * sin(x) = 0;```
N (Neovius)
```3*(cos(x) + cos(y) + cos(z)) +
4* cos(x) * cos(y) * cos(z) = 0.0;```
W (iWP)
```cos(x) * cos(y) +
cos(y) * cos(z) +
cos(z) * cos(x) -
cos(x) * cos(y) * cos(z) = 0;```
P_W (P W Hybrid)
```4*(cos(x) * cos(y) + cos(y) * cos(z) + cos(z) * cos(x))
- 3* cos(x) * cos(y) * cos(z) = -2.4;```

Web page, applet and Algebraic Surface program by Richard Morris