In Charting the Torus I first described two easy representations, then described what I wanted as a third representation. It was not immediately obvious to me how to do that, so I began an exploration. After many hours of that (spread across several weeks, a few hours now and then), sill with the goal not in sight, it occurred to me that, for the page I was writing, I just wanted to describe a nice way to represent the torus, without explaining how I got there. However, that process of exploration, by which I hopefully shall get there, is itself an important part of how I do mathematics, worth recording. So I moved that exploration here (while it was still in progress).
I'd already established a simple chart of
the torus, T(2), as {[u, v]: u, v are angles modulo turn}. I wanted an
embedding of this in {[x, y, z]: x, y, z are real}, in such a way that
neighbourhoods of the point where u and v are both ±turn/2
become neighbourhoods of infinity
(i.e. the complements of bounded
regions) in [x, y, z] space, with z close to zero there, while the two circles u
= 0 (with v varying) and v = 0 (with u varying) become actual circles, of radius
1. The u = 0 one lies in the x = 0 plane, centred at [0, 0, −1], so that
it passes through [0, 0, 0], tangent to the y-axis as it does so; the v = 0 one
lies in the y = 0 plane, centred at [0, 0, 1], so that it also passes through
[0, 0, 0], tangent to the x-axis as it does so. This gives us z = Cos(v)
−Cos(u) on the two circles, which supplies a reasonable relation we can
try to apply throughout the surface.
In particular, this gives z = 0 on the u = ±v diagonals of the chart,
which it then seems natural to map to the x = ±y diagonals of the z = 0
plane. A half-turn rotation about either of thse axes should be a symmetry of
the surface, interchanging the tunnel
and bridge
. These
symmetries would likewise interchange any line of constant u with the
corresponding line of constant v, notably including the case where that constant
is ±turn/2. The lines on which u or v takes this constant value only
meet the diagonals at [±turn/2, ±turn/2], which we're mapping to
infinity; this is also the only place these two lines meet. Where a line on
which u is constant crosses one on which v is constant, we'd ideally like them
to be perpendicular to one another; indeed, it'd be nice if the whole mapping
could preserve angles (a.k.a. be conformal),
generally.
Along with the half-turn symmetry about each diagonal, we'll want mirror symmetry in the planes x = 0 and y = 0: reversing the sign of x (without y or z changing) should correspond to reversing the sign of u (without v changing); and likewise for y and v. Note that the cyclic nature of angles mod turn implies that reflecting the [u, v] space in u = 0 has exactly the same effect as reflecting in u = ±turn/2, so both of these correspond to reflection in x = 0; likewise for v and y.
The u = ±turn/2 line passes through the [0, 0, 2] top of the v = 0 circle and should be perpendicular to that circle when it does so, which is parallel to the x-axis here, as it is when touching that axis at its u = 0 bottom. This thus calls for u = ±turn/2 to be parallel to the y-axis there, just like the u = 0 circle is at its top and bottom. Likewise, the v = ±turn/2 line passes through [0, 0, −2] parallel to the x-axis (like the v = 0 circle at its top and bottom). It is then natural and symmetric to continue u = ±turn/2 in the x = 0 plane, arching down on either side of its [0, 0, 2] peak, to assymptote the y-axis (with y tending to ±∞ and z tending to zero) as v tends to ±turn/2; and, likewise, for v = ±turn/2 to continue in the y = 0 plane, arching up on either side of [0, 0, −2] to asymptote the x-axis (with x tending to ±∞ and z tending to zero) as u tends to ±turn/2.
With one line of constant u and another of constant v mapped to circles, a natural question is whether we can map other such lines to circles. One of these is [turn/4, v], whose image passes through [1, 0, 1] at v = 0.turn, two points [y, ±y, 0] at v = ±turn/4, for some y, and [x, 0, −1] at v = turn/2, for some x. For these to be coplanar, the plane must contain a line parallel to the y axis (since two points on it differ only by a displacement in y) and we must have, from the variation of z with x, (x −1) = 2.(y −1) for the particular points noted, making our four points [1, 0, 1], [t +1, ±(t +1), 0] and [2.t +1, 0, −1] for some t. This gives us a diamond centred at [t +1, 0, 0] with diagonals of lengths 2.(t +1) and 2.hypot(t, 1); we aren't going to get a circle to fit that, but we could get an ellipse to fit.
The circle through [1, 0, 1] and [t+1, ±(t+1), 0] crosses the y = 0 plane again at some point [1, 0, 1] +2.(1 +k).[t, 0, −1] where (1 +k).hypot(t, 1) is the radius of the circle. Its diameter within the y = 0 plane is cut into displacements [t, 0, −1] and (1 +2.k).[t, 0, −1] by the chord between [t+1, ±(t+1), 0] which, in turn, is cut into equal halves of length 1+t. The intersecting chord theorem then tells us (1 +2.k).(1 +t.t) = 1 +2.t +t.t, whence k = t/(1 +t.t). That makes the circle's radius (1 +t +t.t)/hypot(t, 1) and puts the outer end of our diameter at [1 +t +2.t.t, 0, −(1 +t)].(1 +t)/(1 +t.t). Thus revising our [turn/4, turn/2] point to map (: [turn/4, v] ←v :) to a circle is possible but messy. In any case, a circle in the 3-dimensional embedding space is a distraction, since it would not be a circle in the resulting 2-manifold's metric.
So let's forget about circles and just concentrate on some lines in the surface that I've prosivionally mapped out, for some functions r, s mapping angles to reals:
We'll want r(u) and s(u) to vary somewhat like Tan(u/2), so that they stretch to ±∞ as u approaches ±turn/2. To map the u or v in {±turn/4} lines to, albeit not circles, at least something vaguely like them we'll want r to be about twice as big as s, at least near u = turn/4. This (although it's fiddly to show) incidentally also leads small circles in [u, v] space about [±turn/2, ±turn/2] to map to approximate circles (albeit of radii getting bigger as the [u, v] circle gets smaller) close to the x,y plane at large radii. So provisionally take s(u) = k.Tan(u/2), r(u) = 2.k.Tan(u/2) = 2.s(u), for some scale factor k. Consideration of the neighbourhood of [u, v] = [0, 0].turn rather suggests k = 2.
Sin and Cos can be expressed in terms of Tan of half the angle, leading to Cos(u) +1 = 2.k.k/(k.k +s(u).s(u)), Sin(u) = 2.k.s(u)/(k.k +s(u).s(u)) and z = 2.k.k.(1/(k.k +s(v).s(v)) −1/(k.k +s(u).s(u))). With s(turn/4) = k.Tan(turn/8) = k, this turns our later curves into:
The diagram here shows the two straight u = ±v diagonal paths,
dashed where concealed
(in this view from above
) by
the bridge
, over which the u = ±turn/2 ridge-line passes, with the
v = ±turn/2 trench-line sideways to it also dashed where it passes
through the tunnel
under the bridge. These last two are straight
when seen from above but vary in z (the altitude concealed by this diagram),
unlike the two diagonals, which are truly strait (and at constant z = 0). The u
= 0 circle around the centre of the tunnel is hidden below the u =
±turn/2 line and the v = 0 circle is omitted here because it would
misleadingly appear to be a continuation of the v = ±turn/2 line where
the latter is actually concealed.
The curve on which the surface is vertical (that is, has [0, 0, 1] as a
tangent vector) is also indicated; we see two sides of the bridge
joined
to two walls of the tunnel
(dashed because concealed under the bridge).
Although these appear to meet in mutual tangency at an end-point, they are all
part of one smooth curve that is itself vertical at the apparent end-point,
moving outward close to a vertical [±x, ±x, z] plane, with its x
value's increase slowing to a halt and then reversing while its z-variation
dominate. This curve of vertical tangency can be continuously deformed away
towards the point where the two diagonals meet: it corresponds to a curve
roughly resembling [u, v] = [Cos(t), Sin(t)].turn/4 (and sharing, with this, the
points [±turn/4, 0] and [0, ±turn/4] at which the u = 0 and v = 0
circles have vertical tangents). If you imagine a loop of some
stiff-but-springy material, such as wire, take hold of it with the thumb and a
finger of one hand on one diameter and the thumb and a finger of the other on
the perpendicular diameter, then pull your hands apart while pinching inwards,
you'll bend the loop into a curve of roughly this shape. It is, likewise,
roughly the shape of the seam on a tennis ball.
If we interpret this curve of vertical tangency as actually [u, v] = [Cos(t), Sin(t)].turn/4, the points where it meets the diagonals are [u, v] = [±1, ±1].turn/4/√2, yielding [x, y, z] = [±1, ±1, 0].s(turn/4/√2). That value of s at an irrational multiple of a turn would, with s(u) = k.Tan(u/2), give us roughly 0.6205×k. The way I've drawn the diagram (which reflects my geometric intuitions) strongly suggests this is greater than 1, the magnitude of x or y where the other is zero, hence k > 1.6116 (this is just a little short of the golden ratio).
Let's now consider one of those loops on which one of u and v varies while the other is constant at ±turn/4. Taking u = turn/4 and varying v we cycle through [1, 0, 1], [k, k, 0], [2.k, 0, −1] and [k, −k, 0], with colour indicating z-value to distinsuish the first, at z = 1, from the v = ±turn/2 line it appears above, on which the third lies. As this touches the [u, v]-space loop of the curve of vertical tangency, but lies outside it in [u, v] space, it remains above that curve (hence visible from above) as it runs along the side of the bridge and begins descending to cross the diagonal further out than the curve of vertical tangency does.
Consider the line of constant u through the two right-hand
(apparent) corners
of the curve of vertical tangency. As it does crosses
the curve at points where u = ±v, it crosses v = 0 inside the curve, so
at u < turn/4, where the curve hits v = 0. Thus the top of the [x, y, z]
form of this line of constant u is somewhere on the under-side of the bridge,
hidden from view by the bridge. It curves down the roof and side-walls of the
tunnel, emerging towards the opening as it descends, to pass through either x =
±y diagonal just where the surface's direction perpendicular to the
diagonal is vertical, entering the trench and thus remaining on the same side of
the x = ±y plane whose intersection with z = 0 it just crossed, to then
run across the trench (visible from above) and back up the other side in similar
manner. Thus, in our x-y plots, this line of constant u would be confined
between the curve of vertical tangency and the diagonal as it approached it,
tangent to it at the corner
and then curving back away from it outside
the tunnel. A similar thing would happen for a line of constant v through a
pair of the corners
of the curve of vertical tangency.
With that to give us a sense of what's going on, let's back up from believing s(u) = k.Tan(u/2) and r(u) = 2.s(u); those were only rough guestimates anyway, with s(u) linear in u near u = 0 (as Tan(u/2) is) and tending (as Tan(u/2) does) to infinity near ±turn/2, where r(u) needs to be about twice it. Let's now look at how each of x and y varies with u and v, with z = Cos(v) −Cos(u) still.
So, at each fixed u, we see x = Sin(u) near v = 0, 2.Tan(u/2) near v = u (at least for small u) but more like 4.Tan(u/2) near v = ±turn/2. Near v = ±u the variation seems to mix Tan(u/2) and Tan(v/2), with the former dominating for small u but the latter dominating the mix by the time u gets to turn/4. So x varies little with v when Sin(u) or Sin(v) is small but more with v than with u when both have large Sin.
Eventually (via a digression on scaling along rays based on analogy with a standard way to flatten the punctured sphere) it occurs to me to try
which we can refactor via t = Tan(u/2), w = Tan(v/2), whence 1 +Cos(u) = 2/(1 +t.t), as:
which I now have to explore to see what it looks like. Finally it is time to learn how to use matplotlib. Sure enough, that ends up looking sensible enough and close enough to what I wanted.
Here's that digression I mentioned, preserved for posterity because it was part of my exploration:
Perhaps a digression: in my first three-dimensional form of a torus, with inner and cross-section radius both 1, [(Cos(v) +2).Cos(u), (Cos(v) +2).Sin(u), Sin(v)], there are two unit circles: its u = 0 unit circle [Cos(v) +2, 0, Sin(v)] and its v = turn/2 unit circle [Cos(u), Sin(u), 0]. We can rotate and translate this initial form – as [y, −z, 1 −x] ← [x, y, z] to make those unit circles be the two that anchor our model – and reparameterise, [u, v −turn/2] ← [u, v] to get [(2 −Cos(v)).Sin(u), Sin(v), 1 −(2 −Cos(v)).Cos(u)], whose u = 0 circle is [0, Sin(v), Cos(v) −1] and v = 0 circle is [Sin(u), 0, 1 −Cos(u)], matching our anchors. We now want to project the u = turn/2 = v point of this, [0, 0, 4], out to infinity while preserving the three other points on the [0, 0, z] axis.
When we flatten the punctured sphere, we do so by connecting each point on
the sphere to the puncture by a straight line and projecting the point onto the
point where that line cuts either the tangent plane to the sphere opposite the
puncture or the equatorial
plane paralle to this through the sphere's
centre. On each ray from the puncture to a point of the sphere, this just
scales lengths by the ratio of the point on the sphere's distance from a tangent
plane at the puncture to the distance of the puncture from the plane onto which
we're projecting the sphere. So we could consider borrowing that ratio from
this approach and applying it to our punctured torus, albeit adjusting for the
fact that not all points are headed for a single plane.
None the less, the u = ±v points [(2 −Cos(u)).Sin(u), ±Sin(u), 1 −(2 −Cos(u)).Cos(u)] are all headed for the z = 0 plane, at distance 4 from the puncture; each such point is at distance 3 + 2.Cos(u) −Cos(u).Cos(u) = 1 +power(2, 1 +Cos(u)) from the tangent plane at the puncture, so we want to scale along its line by 4/(power(2, 1 +Cos(u)) +1). As it happens, 1 +Cos(u) = 2.power(2, Cos(u/2)), making this factor 1/(power(4, Cos(u/2)) +1/4). So what happens if we apply this same factor to any other points in which the ray from [0, 0, 4] through [(2 −Cos(u)).Sin(u), ±Sin(u), 1 −(2 −Cos(u)).Cos(u)] may meet the torus. Note that none of these rays meets the two unit circles we started with, or indeed the x = 0 or y = 0 plane, aside from the ones whose u = ±v point is either (the degenerate case) [0, 0, 4] itself or the u = 0 = v point [0, 0, 0], for which the scaling is 1.
Four such u = ±v points are where their magnitudes are turn/4, giving us the points [±2, ±1, 1]. These are at distance 3 from the tangent to the puncture, so we'll be scaling them by 4/3. Given that these have maximal y-value among points on the primitive torus, their rays do not pierce that torus again after passing through them. I think the only u = ±v points whose rays from the puncture do meet the torus again are those for smaller values of u and v than turn/4. So perhaps this isn't such a viable line of enquiry, after all.
Pause to look (bearing in mind the Sin and Cos of twice an angle in terms of those of the angle) at some rearrangements of
and, of course, the same can be done with u and v swapped; which makes no difference to the final result, so – combined with 2.Tan(u/2).Cos(u/2).Cos(u/2) = 2.Sin(u/2).Cos(u/2) = Sin(u) – this lets us rewrite our formulæ in the more symmetrical form:
Of course, the new denominator of x and y is zero when Cos(u) = −1 = Cos(v), but that's when u = ±turn/2 = v, the puncture, which we're excluding in any case. In this form we avoid the half-angle formulae and the symmetries are relatively easy to see.
Where u = ±v, we're assured z = 0 since Cos(u) = Cos(±u) as Cos is an even function. We also have Tan(u/2) = ±Tan(v/2), or t = ±w; from which, in the second form, it's immediately clear that x = ±y; indeed, x = 2.t.(1 +t.t)/(1 +2.t.t), rather than the approximately t previously guessed. So we do, indeed, get the intended z = 0 plane's [x, y]-diagonals as our [u, v] square's diagonals – which are, of course, also our [t, w] plane's diagonals – even if the mappig is a bit more complex. Each of x and y is, give or take a sign,
and takes the value 4/3 when u = turn/4. Multiplying the last two forms, we get the square of x or y, or their product (give or take sign), as (1 −Cos(u)).power(2, 4/(3 −Cos(u)))/(1 +Cos(u)) = (2/(1 +Cos(u)) −1).power(2, 4/(3 −Cos(u))).
When v = 0, the 1 −Cos(v) factor in the denominator of x and y is zero, leaving x = Sin(u), z = 1 −Cos(u) and we get our v = 0 circle through the origin, centred at [0, 0, 1], in the y = 0 plane. Likewise for the u = 0 circle centred at [0, 0, −1] in the x = 0 plane. When v is ±turn/2, the denominator is 1 −(1 −Cos(u))/2 = (1 +Cos(u))/2 and x = 2.Sin(u)/(1 +Cos(u)) = 2.Tan(u/2), with z = −(1 +Cos(u)), so that we get the line in y = 0 through [0, 0, −2] asymptotically approaching the x-axis from below as x tends to infinity at either end. Likewise for the corresponding u = ±turn/2 line in the x = 0 plane, through [0, 0, 2] and asymtoting the y-axis as y tends to infinity at each end.
So we do indeed get the four principal lines I initially sketched. It's
worth noting that the x-axis asymptote has x = 2.t so −z = 1 +Cos(u) =
1/(1 +t.t) = 4/(4 +x.x) and likewise the y-axis asymptote has z = 4/(4 +y.y); so
these curves have quite simple forms in [x, y, z] space, without needing
the external
chart's co-ordinates to describe them.
For any constant u not in {0, ±turn/2}, the denominator 1 −(1 −Cos(u)).(1 −Cos(v))/4 varies with v only via Cos(v), so flipping the sign of v doesn't change its value; and, as 1 −Cos(u) lies strictly between 0 and 2, even where 1 −Cos(v) attains its bounds the denominator is positive. As a result, x and y are bounded, y flips sign on negating v but x is unchanged, so −c ←v induces symmetry under reflection in the x-axis. Likewise, for any constant v not in {0, ±turn/2}, variation of u gives us a bounded loop symmetric about the y-axis.
To ease the workings below, introduce b(u, v) = 1 −(1 −Cos(u)).(1 −Cos(v))/4, so x = Sin(u)/b(u, v), y = Sin(v)/b(u, v); in particular, note that x.Sin(v) = y.Sin(u). Let's now look at the derivatives of our embedding (reminder: radian.Sin' = Cos, radian.Cos' = −Sin,
Thus ∂x/∂u is zero when x.Sin(u) = 1 −Cos(u), which happens when b(u, v) = 1 +Cos(u), so
When v is ±turn/2, this only arises for u = ±turn/2, the excluded point at infinity; indeed, b(u, v) = 1 −(1 −Cos(u))/2 = (1 +Cos(u))/2 and radian.∂x/∂u = 2/b(u, v) −1/b(u, v) = 1/b(u, v) is positive for all u other than ±turn/2. Thus on v = ±turn/2, x increases monotinically with u; likewise, on u = ±turn/2, y increases monotonically with v. On v = 0, b(u, v) = 1 so radian.∂x/∂u = Cos(u) and x attains its ±1 bounds at u = ±turn/4; likewise, on u = 0, y attains its ±1 bounds at v = ±turn/4.
With Cos(u) = (Cos(v) −1)/(Cos(v) +3) we get 1 −Cos(u) = 4/(Cos(v) +3) and 1 +Cos(u) = 2.(Cos(v) +1)/(Cos(v) +3) so Sin(u).Sin(u) = 8.(Cos(v) +1)/(Cos(v) +3)/(Cos(v) +3) = 8.Sin(v).Sin(v)/(Cos(v) +3)/(Cos(v) +3)/(1 −Cos(v)) so Sin(u) = ±4.Sin(v)/(Cos(v) +3)/√(2 −2.Cos(v)). We also get b(u, v) = 1 −(1 −Cos(v))/(Cos(v) +3) = (Cos(v) +3)/(2.Cos(v) +2), so y = Sin(v).(Cos(v) +3)/(2.Cos(v) +2) and x = ±2.Sin(v)/(Cos(v) +1)/√(2 −2.Cos(v)) = ±√(2/(Cos(v) +1)). Thus Cos(v) = 2/x/x −1, Sin(v).Sin(v) = 4.(1/x/x −1)/x/x, Sin(v) = (2/x).√(1/x/x −1), y = (1/x/x +1).√(1 −x.x) and all points where x is stationary with respect to u must lie within 1 of the y-axis. This is plainly wrong, so I must have made some mistakes above …
As for ∂x/∂v, it'll be zero precisely when x or y is zero, or if Cos(v) is 1; the latter implies y = 0, so we only have to consider x or y being zero. For constant u in {0, ±turn/2}, x is zero, hence so is ∂x/∂v and x is independent of v. For any other value of u, x cannot take the value zero so ∂x/∂v is only zero where y = 0; each curve of constant u is a loop that attains its maximum and minimum where it crosses the x-axis. Likewise, v in {0, ±turn/2} gives y constant zero, independent of u; and any other constant v curve is a loop that attains its maximum and minimum on the y-axis.
At u = ±v, with x = ±y, we get 4 −4.b(u, ±u) = (1 −Cos(u)).(1 −Cos(u)) and 4.b(u, ±u) = 3 +2.Cos(u) −Cos(u).Cos(u) = (3 −Cos(u)).(1 +Cos(u)), so, using the earlier formulæ for x or y (give or take sign):
so ∂x/∂u.power(2, 1 −Cos(u)) = ±∂x/∂v.(1 +Cos(u)). So x varies faster with u than with v when 1 +Cos(u) > 1 −2.Cos(u) +Cos(u).Cos(u), i.e. when 0 > Cos(u).(Cos(u) −3) or 0 < Cos(u).(3 −Cos(u)). Since 3 −Cos(u) is always positive, this just means Cos(u) > 0. So x varies faster with u than with v, close to the diagonals, when u and v are within turn/4 of zero; and, in that case, y varies faster with v than with u. When u and v are further from zero than turn/4, the right (or left) angle, x varies faster with v than with u and y varies faster with u than with v.
At u = ±v = ±turn/4, we have 1/b(u, v) = 4/3 = ±x = ±y with ∂x/∂u, ∂y/∂u, ∂y/∂v and ∂x/∂v all of equal mangnitude 4/9/radian while ∂z/∂u and ∂z/∂v have opposite sign and magnitude 1/radian.
The usual g = dx×dx +dy×dy +dz×dz metric on {lists ({real}: |3)} duly induces a metric on {lists ({angle}: |2)} via our embedding's
whence
Let's now examine the coefficient of du×dv +dv×du, the off-diagonal term in our metric, expanding x and y in terms of b and exploiting Sin.Sin = (1 −Cos).(1 +Cos):
and that's definitely not always zero, so the transformation isn't conformal. At this point, it occurs to me that I could introduce a scaling of z by some power of b to make it less different in form from x and y. So consider z = (Cos(v) −Cos(u))/√b(u, v). When u is ±turn/2, this'll give z = (Cos(v) +1)/√(1 −(1 −Cos(v))/2) = √(2 +2.Cos(v)) and likewise v = &plumsn;turn/2 will give us z = −√(2 +2.Cos(u)). That'll give
We obtain
as two tangent vectors to our surface in [x, y, z] space, images of the tangents to the u and v directions in the space of two angles. A normal to the surface shall then be their cross product (here g is the usual metric and μ the volume-form implied by a square root of its determinant),
The inner product of the tangents is
which isn't generally zero. What I see in the plots from matplotlib suggests these lines do meet in right angles, so I suspect there are some errors in my wokring.
At u = turn/4 = v we have 1/b = 4/3 = x = y and z = 0; this gives U = [4/9, 4/9, 1], V = [4/9, 4/9, −1], so g\μ(U^V) = [−8/9, 8/9, 0], so the normal is horizontal and this is the point at which the line of vertical tangency crosses the diagonal; the same shall happen at all four {u, v} ⊂ {±turn/4} points. Both have squared length 113/81, so the angle between them has cosine &minud;49/113, just under a third of a turn.