# Torus

Shape · (x, y, z) = f(u, v, t)

`((3 + cos(v)) · cos(u),  sin(v),  (3 + cos(v)) · sin(u))`

[Open in the app](https://www.wavelace.com/app#p=59) · [This page](https://www.wavelace.com/presets/torus)

### What it draws

The parameter `v` goes round the tube and `u` carries the tube round the ring. Read `3 + cos(v)` first: it is the distance from the vertical axis, `3` at the top and bottom of the tube, `4` on the outside and `2` on the inside. The width and the depth are that distance turned through `u` as `cos(u)` and `sin(u)`, so the ring lies flat on the ground plane.

The second expression is the height, `sin(v)`, so the tube reaches `±1` above and below the ring. Nothing depends on `t`: the donut sits still.

### The two radii

A torus is fixed by two numbers, and both are visible in the formula: the centre circle has radius `3` and the tube radius `1`. Every point of the surface is exactly `1` from that centre circle. That is what makes it a *surface of revolution*: a circle of radius 1, drawn in a vertical plane with its centre 3 out from the axis, swept once round. Because `3 > 1` the hole stays open and this is a ring torus.

The deeper fact is in the parameters. Each point is named by a pair of angles, one round the ring and one round the tube, and neither can be combed away. That is what it means to say the torus is a product of two circles, and why the mesh lines close on themselves in two different ways.

### Try

- `Top` in the deck: two concentric circles, at radius `2` and `4`.
- Change both `3`s to `1`, giving `(1 + cos(v))·cos(u)` and `(1 + cos(v))·sin(u)`. Now the two radii are equal and the hole shuts to a single point: a horn torus.
- Set `Span of v (×π)` to 1: only half of each tube section is drawn, leaving the top half as an open gutter.
- Set `Turns of u` to 0.5 for half a donut, with the circular cross-section on show at both cut ends.

### Read more

- [Torus](https://en.wikipedia.org/wiki/Torus)
- [Surface of revolution](https://en.wikipedia.org/wiki/Surface_of_revolution)
- [Genus (mathematics)](https://en.wikipedia.org/wiki/Genus_(mathematics))
