No picture surface keeps everything
A picture is a set of directions turned into a set of marks. The eye at a point receives light along rays; the picture records where each ray went. Nothing in that description says the marks have to be on a plane, and for most of the history of pictures they were not — the marks were on the inside of a dome, on the curve of a vault, on the wall of a cave that was never flat to begin with.
The flat picture plane is a choice. It is such a good choice that it stopped looking like one somewhere in the fifteenth century, and the language of the subject still carries the assumption: a photograph taken on a curved surface is called distorted, and the flat one is called correct. That is not a statement about geometry. It is a statement about which surface the speaker grew up with.
What follows measures the six against each other. Not on how they look, which is a question about the reader, but on the three things a surface can do to the world it is recording.
A surface, as a map
The comparison needs the six surfaces to be the same kind of object, and the way to make them so is to strip out everything that is not the surface.
A camera on this site is a substantial thing: an eye, a target, an up vector, an image size, a focal length and a principal point. A picture surface is much smaller. It takes a direction — a unit vector in the camera’s own frame, x to the right, y down, z along the view — and returns a point in the picture, in units of the focal length. That is the whole interface. It knows nothing about where the eye is, nothing about the scene, and nothing about how large the picture is going to be printed.
The smallness is deliberate and it is what makes the measurements trustworthy. lib/projective.js on this site is never shown the scene, which is what makes it worth something when it recovers a focal length from drawn edges. lib/surfaces.js is never shown the scene either. Every number in this essay comes out of the map from directions to marks, so none of them can have been rigged by choosing a scene that flatters one surface — there is no scene for the numbers to come from.
Two consequences follow immediately, and both are checked rather than assumed.
The first is that every surface must be invertible: given a mark, the direction it came from must be recoverable, and pushing a direction out and back must return it. That round trip holds to about 3 × 10⁻¹⁶ for all six, which is the floating-point floor. It matters because the rectification machinery in the metrology field goes backwards through a surface, and an inverse with a sign wrong produces a rectified picture that looks like a rectified picture.
The second is that the derivatives can be taken numerically, by differencing on the sphere, rather than derived by hand for each surface separately. Six hand-derived Jacobians is six opportunities for an algebra slip, and a slip would show up as a plausible number. The differencing is checked instead against the one case with a short closed form: the flat plane’s area scale is sec³θ, and at 42° off axis the differenced value and the closed form agree to eleven digits. If that ever drifts, every other number in the file is reporting the step size rather than the surface.
Three properties, and what it costs to keep them
A surface can be asked to preserve three things, and the three are worth naming precisely because the loose versions get confused with each other.
Straightness. A straight line in the world is a set of directions lying on a great circle of the sphere of view. A surface preserves straightness when it sends every such set to a straight line in the picture. This is what makes a photograph of a building have straight edges, and it is what makes a ruler laid on a photograph mean anything.
Angle. Two lines crossing at a right angle in the world should cross at a right angle in the picture. The proper name for a surface that does this is conformal, and the word carries a second requirement that is routinely dropped: the two arms of the angle must also be magnified by the same amount. A surface that keeps the angle while stretching one arm twice as far as the other has not preserved shape, and shape is what the word is being used to promise.
Scale. A patch of the world should occupy an area in the picture proportional to the solid angle it subtends. This is the property that lets a picture be counted rather than looked at — the fraction of sky covered by cloud, the fraction of a canopy that is leaf.
Each property has a number attached to it here, and each number is measured from the surface’s own map rather than quoted from a reference. The straightness measure is the largest departure of a line’s image from the chord joining its ends, as a fraction of that chord. The angle measure is the worst departure from ninety degrees over every right angle at a point. The scale measure is the determinant of the map’s derivative, against its value on the optical axis.
The corner that cannot be filled
The plot has a shape, and the shape is the field’s central fact. Every surface sits either against the left edge or against the bottom. None sits in the corner.
That is not a survey result. It is Beltrami’s theorem, which says that the only maps of the sphere sending great circles to straight lines are the gnomonic ones — the flat picture plane, up to a change of coordinates — and the flat picture plane is conformal at exactly one point, the centre, and nowhere else. So the corner is not empty because nobody has invented the right surface. It is empty because filling it is impossible.
There is an obvious objection to putting a theorem in a plot. A claim of impossibility is the easiest kind of claim to make and the hardest to check, and an assertion that has never rejected anything proves nothing. So the check behind this figure is written the other way round: it takes the six surfaces, decides for each whether it is straight and whether it is conformal, and fails if any is both. Loosen the definition of conformal far enough that the flat plane qualifies — allow two hundred degrees of angle error — and the check fires. It is a test that can fail, which is the only kind worth printing a theorem next to.
The angle test that measured nothing
There is a story attached to how the vertical axis of that plot is computed, and it is worth telling because the same mistake has now been made twice on this site in two different costumes.
The obvious way to measure angle distortion is to take two perpendicular directions at a point, push both through the surface, and compare the angle between the results with ninety degrees. That was the first implementation. It reported the cylinder’s worst angle error as 5.5 × 10⁻¹⁰ degrees — a perfect score, machine precision, indistinguishable from stereographic.
The cylinder is not conformal. A shape near the top of a cylindrical panorama is visibly taller than it should be, and anyone who has stitched one has seen it.
What went wrong is that the two perpendicular directions were built by a helper that, for a cylinder, happens to produce exactly the azimuth and the elevation — the surface’s own coordinate directions. Those two do stay perpendicular. Every other right angle at the same point does not. The test was being evaluated on the one input at which it could not fail.
This is precisely the shape of the cross-ratio error the foundation phase caught, where four consecutive divisions of a receding row gave the equal-spacing-by-eye method a perfect score because four points equally spaced in the picture have the same cross-ratio as four equally spaced in the world. A necessary condition, checked where it is automatically satisfied, is not a test. Both versions survive in the code, and both are asserted: the naive one must pass the cylinder, and the honest one — which turns the right angle through a half-revolution and keeps the worst case — must reject it. It rejects it by 5.62 degrees.
The lesson is not about cylinders. It is that a check whose input is generated by the same machinery that produced the thing being checked will tend to pick the input that agrees, and that this happens without anybody deciding it should.
What each surface actually pays
With the measurements honest, the six sort into a small number of positions.
The flat plane keeps every straight line straight, exactly, to floating-point noise. It pays for it in scale: the area magnification is sec³θ, which is eight at sixty degrees off axis and unbounded at ninety. Its picture is finite only for fields of view strictly below 180°, and the approach is fast — the half-width of the picture multiplies by 6.6 between 120° and 170°, and there is no such thing as a flat photograph of a hemisphere.
The cylinder keeps horizontal scale even all the way round and can hold 360° without incident. Its anisotropy is sec φ, where φ is the elevation, so a shape at the top of the frame is stretched vertically relative to one at the horizon. Verticals stay vertical; horizontals bow. Its whole account is in the cylinder’s own essay.
Stereographic keeps every angle and every shape, exactly. It pays in area, which grows without bound toward the antipode, and it bends straight lines by more than any surface here except in one particular sense: of the five curved surfaces it bends the test line the least, at 3.5% of its own chord against the cylinder’s 5.9%. It is the surface a mathematician reaches for, the one a photographer sells as a “little planet”, and the subject of its own essay.
The equal-area fisheye does exactly what its name says. Its area scale is a flat line at 1.000 across the entire field, which is the only exactly-preserved quantity in the whole comparison other than stereographic’s angles. It is the right surface for a sky-fraction measurement and the wrong one for reading a face.
The equidistant fisheye preserves neither, and preserves something else instead — radial distance in the picture is proportional to angle off axis, so the picture is a protractor. That is why it is what a surveyor’s fisheye is, and why each fisheye rule is a different instrument.
The equirectangular surface preserves nothing at all. Its anisotropy is sec φ, identically the cylinder’s; its areas run by a factor of 1.1 over the field drawn here and by an unbounded factor at the poles. It exists because addressing a direction by two angles is simple, and every 360° photograph ships in it for that reason and no other.
Neither is the distorted one, and here is the number
The foundation phase drew a plane and a cylinder side by side and said that neither was the distorted one. That was a claim with nothing behind it, and it is the reason this field exists.
The claim now has three numbers behind it, and the numbers do not settle the question so much as dissolve it. Asking which surface is undistorted is asking which of straight lines, shape and area is the real one, and no answer to that question comes from geometry. It comes from what the picture is for.
A photograph of a building, to be measured, wants straight lines: a flat plane. A photograph of a room, to be understood, wants shape: something near stereographic. A photograph of a sky, to be counted, wants area: an equal-area fisheye. A photograph of everything, to be stored and re-projected later, wants simple addressing: equirectangular, which is why the format nobody would defend on any other ground is the one every camera writes.
The same trade, on a different sphere
Anyone who has met map projections will have recognised the shape of this argument some paragraphs ago, and the recognition is not a coincidence. A map projection is a map from the sphere to the plane; a picture surface is a map from the sphere of view to the plane of the picture. They are the same mathematics, and three of the six surfaces here — stereographic, equirectangular, and the equal-area azimuthal that the equal-area fisheye is — are named after their cartographic uses.
The theorem is the same too. Tissot’s indicatrix, which every cartography text draws as an ellipse showing what a map does to a small circle, is exactly the singular-value pair computed here: the two axes are the largest and smallest magnification, their ratio is the anisotropy, and their product is the area scale. A conformal projection is one whose indicatrix is a circle everywhere. An equal-area projection is one whose indicatrix has constant area. That no projection is both conformal and equal-area is the first thing a cartography course establishes, and it is the same statement as the empty corner above with one axis swapped.
What differs is the question being asked. A cartographer has a sphere that exists, and is deciding how to flatten it for someone who will measure things on the flat version. The sphere here does not exist: it is the sphere of directions from one eye at one instant, and the reader of the picture is not going to measure the map, they are going to look at it — from a place that the picture itself determines. That is why the essays here end where they do, with a viewing distance in centimetres, and a map essay ends with a scale bar. The surfaces are shared; the reason for choosing between them is not.
What this changes about the rest of the site
Every other figure here is cast onto a flat plane, and every viewing-distance number on the site depends on that. The claim that a picture shown 160 mm wide at 40° across is correct from 22 cm assumes a flat picture and a rectilinear projection; on a cylinder the same field of view has a different half-width and therefore a different correct distance, and on a fisheye the notion of a single correct distance is different again, because the surface is no longer a plane the eye can be perpendicular to.
That is not a defect in the earlier essays. It is the reason the flat case had to be exact before this one was written: a curved-surface essay written first would have had nothing to be curved against. But it is a boundary worth stating plainly, and it is stated here rather than buried — every viewing distance quoted on this site is the viewing distance for a flat picture, and the surface is the first assumption, not the last.
The second boundary is the one this site always states. All of this is geometry. It says what a surface does to a set of directions, and it says nothing at all about what a viewer notices. A cylindrical panorama with eighteen degrees of angle error at its edges reads perfectly well to almost everybody, because the eye is not a measuring instrument and pictorial depth cues do not arrive through a protractor. The measurements here are about projection. Whether a reader can see the difference is a fact about seeing, and that question deserves better than to borrow the authority of a number computed on a sphere.