Surfaces that are not flat

The kink at a seam

A cube map is six flat pictures, so every great circle is drawn exactly straight inside a face — to 3e-15 of its chord — and breaks at the join. The break is a kink and not a bend, it is exactly zero at a seam's midpoint whatever the slant, and it is bounded by 2·atan(½) = 53.130° at the corner.

Worth reading first: Six flat pictures of everything · When the picture surface is not flat · The lines a surface leaves alone.

Six flat pictures of everything establishes what a cube map is and why it exists: six ordinary flat pictures at 90° apiece, covering the whole sphere with nothing worse than a factor of 5.196 in area at a face’s corner. A pole is a line says what it buys — it is the only surface here with no singular direction at all, because it never claims to hold the sphere in one chart.

The price is paid at the joins, and this essay is what the price actually is.

Each face is a gnomonic chart — a plane through the centre of the sphere, which is to say an ordinary pinhole picture — so within one face every great circle is drawn exactly straight. That is the strongest straightness property any surface here has. Cross a seam and the line is still made of straight pieces, and the pieces do not line up.

Straight inside a face, broken across the seam: up to 17.52° at this slantSix flat pictures in the usual cross, with 7 straight world lines crossing the seam between the front face and the right one at 30° to the seam. Every one of them is a great circle, so every one is straight in the world; inside a face each is drawn straight to 7e-15 of its own chord, and at the join the two pieces meet at an angle rather than curving into each other. The kink runs from 0.00° at the seam's midpoint to 17.52° nearest the cube's corner. The heavier line is the control: it crosses at the midpoint, and so does every other line through that point, whatever its slant.17.5°12.2°6.2°6.2°12.2°17.5°leftfrontrightbackupdownmidpoint: 0°7 straight lines, at 30° to the seamworst 17.52° · midpoint 0°
Fig. 1 Six flat pictures in the usual cross, with seven straight world lines crossing the seam between the front face and the right one at 30° to it. Every one is a great circle, so every one is straight in the world; inside a face each is drawn straight to 7 × 10⁻¹⁵ of its own chord, and at the join the two pieces meet at an angle rather than curving into each other. The kink runs from 0.00° at the seam’s midpoint to 17.52° nearest the cube’s corner.

A kink is not a bend, and the ordinary measure cannot tell them apart

The distinction in the title is the point of the essay, and it is easy to lose because the usual instrument reports the same thing for both.

Every other surface in this collection bends a straight line: the lines a surface leaves alone measures how far a drawn great circle departs from the chord between its ends, and on a cylinder or a fisheye that departure is a smooth curvature spread along the whole arc. The cube map’s departure from the chord is comparable in size — and it is not a curvature at all. It is two perfectly straight segments meeting at a point.

A kink and not a bend: each side straight to 3e-15 of its chord, meeting at 44.4°Four quantities on one logarithmic scale, and the argument is in which three of them sit on the floor. The closed form and the measurement off the drawn net disagree by 2.0e-13 degrees. Each side of the seam, fitted on its own, bends by 2.6e-15 of its own chord — which is what makes the failure a kink rather than a bend, a distinction the ordinary straightness measure cannot draw because it reports a large number for both. A line crossing at the seam's midpoint reads 1.6e-13 degrees at every slant. And a line crossing 30° along the seam reads 44.42°, which is the row that stops the other three being a statement about a family that happens to be flat.four quantities on one logarithmic scale10⁻¹⁶10⁻¹²10⁻⁸10⁻⁴10⁰the two routes disagree by2.0e-13°each side's own bend2.6e-15 of its chorda crossing at the midpoint1.6e-13°a crossing 30° along the seam4.4e+1°three on the floor and one that is not44.4° at 30° along the seam
Fig. 2 Four quantities on one logarithmic scale, and the argument is in which three of them sit on the floor. The closed form and the angle measured off the drawn net disagree by 2.0 × 10⁻¹³ degrees. Each side of the seam, fitted on its own, bends by 2.6 × 10⁻¹⁵ of its own chord — which is what makes the failure a kink rather than a bend. A line crossing at the seam’s midpoint reads 1.6 × 10⁻¹³ degrees at every slant. And a line crossing 30° along the seam reads 44.42°, which is the row that stops the other three being a statement about a family that happens to be flat.

Three floors and one large number is the shape of that figure, and the large number is what makes it a measurement. The three zeros say: the two computations of the kink agree, each side really is straight, and a midpoint crossing really is unbroken. Any one of those alone would be an arithmetic check. Together with a 44.42° that the same machinery produces, they are a description of the failure — the line is exactly straight, twice, and the two straights disagree about direction.

That distinction has a consequence for anybody sampling such a picture. A curvature can be approximated away by drawing a curve; a kink cannot, because there is no curve there. Interpolating across a seam produces something that is wrong in a way no amount of resolution improves, since the true image genuinely has a corner in it.

Zero at the midpoint, whatever the slant

The kink is not the same everywhere along a seam, and where it vanishes is worth more than the maximum.

Nothing at the midpoint, 53.130° at the corner, and the two routes agree to 5e-13°How badly a straight line breaks at a cube-map seam, against where along the seam it crosses, for lines at 30° to it. The curve is the closed form — the difference of two arctangents of the great circle's own axis, which is all the drawn slopes on either side of a seam are — and the dots are the angle measured off the drawn net by fitting a line to each side. They agree to 4.6e-13 degrees over 9 crossings, which is the arithmetic floor and is what makes either route usable on its own. The kink is exactly zero at the midpoint and rises to 53.1301° at the cube's corner, where three faces meet; that bound is 2·atan(½), the angle whose tangent is four thirds.02040-20020where the line crosses the seam, in degrees from its midpointthe angle the two drawn pieces meet at, in degrees2·atan(½) = 53.130°the midpoint: no kink, at any slantlines at 30° to the seamtwo routes agree to 5e-13°
Fig. 3 How badly a straight line breaks against where along the seam it crosses, for lines at 30° to it. The curve is the closed form — a difference of two arctangents of the great circle’s own axis, which is all the drawn slopes on either side of a seam are — and the dots are the angle measured off the drawn net by fitting a line to each side. They agree to 4.6 × 10⁻¹³ degrees over nine crossings. The kink is exactly zero at the midpoint and rises to 53.1301° at the cube’s corner.

Every line through the midpoint of a seam crosses with no kink at all, at any slant. That is a stronger statement than it looks, and it is the control the essay’s whole claim rests on: a figure showing kinks everywhere would be showing that a cube map breaks lines, which is nearly true and not the useful version. What is true is that a cube map breaks lines except along a particular curve, and the exception is exact rather than small.

The reason is symmetry. The midpoint of a seam is equidistant from the two face centres, and the two gnomonic charts meeting there are mirror images across the seam plane. A great circle through that point has slopes on the two sides that are reflections of each other and therefore equal, so nothing breaks.

Move away from the midpoint and the symmetry goes, and the two arctangents stop agreeing. Increase the slant and the same thing happens faster.

Straight inside a face, broken across the seam: up to 42.04° at this slantSix flat pictures in the usual cross, with 7 straight world lines crossing the seam between the front face and the right one at 60° to the seam. Every one of them is a great circle, so every one is straight in the world; inside a face each is drawn straight to 1e-15 of its own chord, and at the join the two pieces meet at an angle rather than curving into each other. The kink runs from 0.00° at the seam's midpoint to 42.04° nearest the cube's corner. The heavier line is the control: it crosses at the midpoint, and so does every other line through that point, whatever its slant.42.0°27.3°13.5°13.5°27.3°42.0°leftfrontrightbackupdownmidpoint: 0°7 straight lines, at 60° to the seamworst 42.04° · midpoint 0°
Fig. 4 The same seven lines at 60° to the seam rather than 30°. The worst crossing is now 42.04° against 17.52°, and the midpoint is still exactly unbroken. Each side is still straight, to 1 × 10⁻¹⁵ of its chord — the slant changes how far apart the two straights point, and nothing else.

The bound, and where it comes from

The worst kink is not unbounded, and the number it is bounded by is a familiar one.

Nothing at the midpoint, 53.130° at the corner, and the two routes agree to 8e-14°How badly a straight line breaks at a cube-map seam, against where along the seam it crosses, for lines at 60° to it. The curve is the closed form — the difference of two arctangents of the great circle's own axis, which is all the drawn slopes on either side of a seam are — and the dots are the angle measured off the drawn net by fitting a line to each side. They agree to 8.2e-14 degrees over 9 crossings, which is the arithmetic floor and is what makes either route usable on its own. The kink is exactly zero at the midpoint and rises to 53.1301° at the cube's corner, where three faces meet; that bound is 2·atan(½), the angle whose tangent is four thirds.02040-20020where the line crosses the seam, in degrees from its midpointthe angle the two drawn pieces meet at, in degrees2·atan(½) = 53.130°the midpoint: no kink, at any slantlines at 60° to the seamtwo routes agree to 8e-14°
Fig. 5 The same measurement at 60° to the seam. The maximum along this family is 45.00°, and the bound the curve approaches at the cube’s corner is unchanged: 2·atan(½) = 53.130°, the angle whose tangent is four thirds. The two routes agree to 8 × 10⁻¹⁴ degrees.

Fifty-three point one three degrees is the three-four-five angle, and it turns up here for a reason that can be stated in one line.

It is worth noticing that the bound does not depend on the slant. Both sweeps above — one at 30° to the seam and one at 60° — approach the same 53.130° at the corner, and only the rate differs. That is because the bound is a property of the two chart normals rather than of the line being drawn: at the corner the disagreement between the charts is maximal, and a line arriving there merely samples it. A family drawn at any slant will find the same ceiling if it reaches far enough along the seam. At a cube’s corner three faces meet, and the two charts on either side of a seam disagree most sharply about a direction that lies along the corner’s own diagonal. The half-angle between the two chart normals there has tangent one half, so the total disagreement is twice its arctangent.

That the bound is attained only at the corner — a single point, where three seams meet — is worth saying, because it means the typical kink is much smaller. Along most of a seam a line crossing at a moderate slant breaks by a few degrees, and the 53.130° is a worst case reached in the one place where the cube map is already at its worst on every other measure too, with an area scale of 5.196 and an anisotropy of √3.

Everything bad happens at the corner, and that is not a coincidence

Three separate measurements of the cube map reach their worst at the same place, and it is worth noticing that they are one fact rather than three.

The kink is bounded by 2·atan(½) = 53.130° and attains it at a corner. The area scale runs from 1 at a face’s centre to 5.196 at a corner. The anisotropy — how much a small circle is stretched into an ellipse — is 1 at a face’s centre and √3 = 1.7321 at a corner.

All three are consequences of one quantity: how far off its own axis a face has to reach to hold a given direction. A face covers 90°, so its extreme directions are 45° off-axis along an edge and about 54.7° off-axis at a corner, and a gnomonic chart’s distortions all grow as the secant of that angle. The corner is simply the furthest any direction gets from any face centre, so it maximises everything at once.

That gives the cube map a clean description as a compromise. Its distortions are those of an ordinary flat picture — the very ones where a surface spends its pixels measures running to ×25 and beyond on a wide plane — truncated at 90° and repeated six times. A plane misbehaves without bound because it is asked to reach arbitrarily far off-axis; a cube face is never asked to reach past its corner, and every one of its numbers is the plane’s number evaluated there.

So the six faces are not a different kind of surface. They are the worst-behaved surface in the collection, used only over the part of its range where it behaves — which is a design worth naming, because it is the opposite of how the other five were arrived at. Those were each derived by asking what property to preserve and accepting whatever behaviour followed. This one starts from a surface whose behaviour is known to be bad and fixes the range instead.

How many seams one line has to cross

The kink is a per-crossing quantity, and a reader wanting to know what a long line costs needs the count as well.

A great circle on a cube crosses from face to face a bounded number of times, and the bound is small: it meets the cube’s twelve edges in at most four places for a generic circle, and exactly four for one that does not pass through a corner or lie in a face plane. So a straight world line, drawn all the way round, is at most four straight pieces joined by at most four kinks — never a smooth curve, and never an arbitrarily broken one.

Set that beside the fraction-straight curve below and the trade sharpens. A short line has no crossings and is perfect. A line long enough to go all the way round has four, which is few — but they are the only defects it has, and each is a corner rather than a gentle departure.

It also explains why the fraction of exactly-straight lines falls so steeply with arc length. The chance of avoiding a seam is the chance of staying inside one 90° face, and that becomes unlikely quickly as the arc grows — not because the surface degrades, but because the faces are only so big.

What the seam costs, as a fraction of lines

The kink is an angle, and the practically useful question is how often a reader meets one.

The cube map has a scale below which everything is straightThe fraction of world lines a cube map draws exactly straight, against how long a piece of the line is drawn. It falls from 95.8% at a 5° arc to 2.8% at 50°. Every other surface here gives the same answer at every length.0%25%50%75%100%10°20°30°40°50°world lines drawn exactly straightlength of the piece drawn, in degrees of arcsampled over 22×22 directionsno other surface here has a scale
Fig. 6 Borrowed from the essay this one sits above: the fraction of world lines a cube map draws exactly straight, against how long a piece of the line is drawn. It falls from 95.8 per cent at a 5° arc to 2.8 per cent at 50°. Every other surface here gives the same answer at every length, because their failure is a curvature that is present at every scale.

That curve is the honest summary of the trade and it says something neither the kink angle nor the area scale does. A cube map has a scale below which it is perfect. A short enough line lies inside one face, is drawn exactly straight, and has no error of any kind — 95.8 per cent of lines at a 5° arc. Every other surface bends every line at every length, by a little.

So the two kinds of surface are not better and worse; they are differently shaped. A curved surface distributes a small error over everything. A cube map has zero error over most things and a large one over the rest, and which is preferable depends entirely on whether the work being done is local.

For sampling a texture, local is exactly right and the cube map wins outright — which is why it is the format graphics hardware uses, and why a pole is a line ends by naming it as the only bounded answer. For drawing a picture somebody looks at whole, a seam running through the middle of a long straight edge is the worst possible artefact, and the smooth surfaces win.

What a chart is, and why this is the general case

The cube map is usually presented as an engineering trick. It is better understood as the ordinary way of covering a curved thing, and the seam is the ordinary price.

A sphere cannot be covered by one chart without a singular direction — a pole is a line argues that from topology, and the cube map is the alternative it names. Cover it with several charts instead and each can be well behaved, and what appears is a transition between charts: two descriptions of the same neighbourhood that have to be reconciled where they overlap.

Here the transition is trivial to state — the two faces are flat and the change of chart is a projective map — and its visible consequence is the kink. The two charts genuinely disagree about which direction a line is going, and neither is wrong. The disagreement is a property of the pair rather than of either — the same shape of statement as undoing a picture made on a curve, where what a rectification needs is not a property of the surface alone.

That is the same shape as the seam a shadow crosses when it runs from a floor onto a wall, or the join between two bands of a scroll, which a scroll is not a panorama measures: two regions each internally consistent, and a boundary at which the reconciliation is visible. A shadow across an edge measures one of those, and the family resemblance is not an analogy — in each case a single object is being described by two maps and the boundary is where the descriptions meet.

Why the seam is where the reader is, and the pole is not

There is an asymmetry between this essay’s defect and the one next door that decides which surface to prefer, and it is not about size.

A pole is a line measures a failure that sits at one direction, and a direction is something a rig can be pointed away from. Aim the singular direction at the tripod, or at the sky, and no reader ever meets it. The failure is severe, unbounded, and easy to hide.

A cube map’s failure is spread along twelve edges, which between them run through every part of the sphere. There is nowhere to point them. A long straight edge in a room — a skirting board, a roofline, the top of a wall — will cross a seam somewhere, and the kink will be in the middle of the thing a reader is looking at.

So the two surfaces trade a large defect that can be hidden against a moderate defect that cannot. For a texture sampled by a machine that never sees a whole line, the cube map’s trade is obviously right. For a picture displayed to somebody, it is obviously wrong, and the equirectangular surface’s wasted pole is the cheaper price.

That is the practical content of the whole comparison, and it is why neither surface is the better one. A defect’s severity and a defect’s reachability are separate properties, and the collection’s other measurements only report the first.

What this does not settle

Three limits.

The kinks here are measured on the unfolded net, which is a way of laying the six faces out on a page and is not how a cube map is used. In a viewer the faces are sampled independently and the seam is never drawn at all; the kink then appears as a discontinuity in what is sampled rather than as a visible corner. The angle is the same number either way, and the artefact it produces is not.

The closed form and the measurement off the net agree to 10⁻¹³ degrees, which is the arithmetic floor, and that agreement is a check on the two implementations rather than evidence about cube maps. Both compute the same geometry from the same face normals; they share the geometry and not the code, which is what makes the check worth running and less than it might appear.

And nothing here measures resampling, which is what a reader actually meets. A cube map is stored as six rasters, and a line crossing a seam is sampled from two of them; how the two are blended is a filtering question with its own literature. The geometry says the true image has a corner. What a filter does with that is somebody else’s subject.

What a draughtsman would do with it

One consequence is worth drawing out because it is constructive rather than cautionary, and it is the sort of thing the rest of this collection is about.

A cube map’s faces are gnomonic charts, which is to say ordinary perspective pictures — so every straightedge construction in this collection works, unmodified, inside a single face. Vanishing points behave, the measuring point behaves, a harmonic conjugate found with a straightedge is the harmonic conjugate. Every projectivity is two perspectivities applies inside a face and does not apply across a seam, because the two faces are two different picture planes.

That gives a clean rule for working on such a picture. Anything local is ordinary perspective and needs no new machinery at all. Anything crossing a seam has to be carried across by the change of chart, which is a projective map between the two face planes — computable, exact, and not something a straightedge can execute by itself.

So the cube map is the one surface in this collection on which the classical constructions remain available. Every curved surface breaks them, because a construction that joins two points with a straight line is assuming the surface draws lines straight; the cube map does draw them straight, six times over, with an explicit map between the pieces.

Six charts, and one angle at the joins

The object is a straight line crossing between two flat pictures, and the finding is that the failure has a different kind from every other surface’s in this collection.

Not a curvature spread thinly along an arc, but two exactly straight pieces meeting at an angle — zero along the midpoint of every seam, bounded by the three-four-five angle at the corners, and absent altogether from any line short enough to stay inside one face. A surface that is perfect below a scale and broken above it, which is what covering a sphere in pieces buys and what it costs.

What links here

Computed from the collection, not written here: the essays that point at this one.

Shares its objects with

Essays that name at least two of the same things, and that neither author linked.

Named objects

A flat tag is an object no other essay names yet.

AnisotropyArea scaleChartCube mapEquirectangularfield of viewGnomonicGreat circlePicture surfaceSeam