Here is an interactive graphic depicting Bianchi-Pinkall flat tori, rendered using Three.js and presented with MathCell:

The figure can be rotated by clicking and dragging with a mouse or swiping on a touch device, as well as zoomed in or out with a mouse wheel or pinching on a touch device. The integers on the buttons determine the overall symmetry of the surface, *i.e.* the number of lobes.

“Flat tori” are so named because they have zero Gaussian curvature in four-dimensional space. Here are a couple good online references for understanding the concepts behind the mathematics necessary to generate this graphic:

Geometry of the Hopf Mapping and Pinkall’s Tori of Given Conformal Type

Bianchi-Pinkall Flat Tori in S^{3}

One general parametrization of a flat torus on a unit 3-sphere in four dimensions is

$[cos\alpha cos\gamma ,sin\alpha cos\gamma ,cos\beta sin\gamma ,sin\beta sin\gamma ]$

where 0 ≤ α ≤ 2π , 0 ≤ β ≤ 2π and 0 ≤ γ ≤ π/2 . The slightly different parametrization used here replaces two variables with their sum and difference,

$[cos(u+v)cos\gamma ,sin(u+v)cos\gamma ,cos(u-v)sin\gamma ,sin(u-v)sin\gamma ]$

and then takes 0 ≤ *u* ≤ 2π and 0 ≤ *v* ≤ π . A particular subsequent parametrization choice makes the third variable depend on one of the others:

$\gamma =a+bsin2nv$

In order to visualize the surface, it must be projected from its four-dimensional space down to our three dimensions. One way to do this is with a typical stereographic projection

$[\frac{x}{1-w},\frac{y}{1-w},\frac{z}{1-w}]$

but the modified stereographic projection

$[rx,ry,rz]\phantom{\rule{2em}{0ex}},\phantom{\rule{2em}{0ex}}r=\frac{{cos}^{-1}w}{\pi \sqrt{1-{w}^{2}}}$

produces output that remains about the same size as parameters are varied. And that’s all the math you need to generate the graphic!

One animatable analytic extension of these tori is to let the index *n* vary continuously in time. With the surface rendered as a wireframe and a bit of rotation added, the result is

This even more fun zoomed far into the graphic:

Quite trippy with just a little bit of math...

*Uploaded 2017.10.17 — Updated 2017.10.25*
analyticphysics.com