Surfaces that are not flat

The cylinder, and the price of going all the way round

A cylindrical picture can hold three hundred and sixty degrees, keeps every vertical vertical, and bows every horizontal. Its cost is a stretch of sec φ in elevation, which is also the equirectangular surface's cost exactly — two surfaces that are always described as different and are identical in the one respect anybody notices.

A panorama is made by standing in one place and turning. The rays all come from the same point, so the result is a picture in the ordinary sense — a record of directions — and the only question is what to record them on. A flat sheet cannot take the whole turn: its half-width is tan(θ/2), which is unbounded at 180° and has already reached six focal lengths at 160°. Something has to give, and what gives is the flatness.

The cylinder is the smallest possible concession. It stays flat in one direction and curves in the other, and it curves in exactly the direction the turning happens.

Five great circles, imaged on the cylinderThe same conic fit reports 1.5e+0 — not a circle, and not a line either.fitted conic: 1.482 from being a circlecylinderthe samples, fitted
Fig. 1 Five great circles — the images of five straight world lines, tilted away from vertical by different amounts — cast onto a cylinder. The conic fitted to each reports something a long way from a circle and a long way from a line. A cylinder does not send straight lines to any simple curve at all.

The map, in two lines

Take a direction as the camera sees it: x to the right, y downward, z along the view. The cylinder’s map is

u=arctan(x/z),v=y/x2+z2.u = \arctan(x/z), \qquad v = y / \sqrt{x^2 + z^2}.

The first coordinate is the azimuth, the angle turned through from straight ahead. The second is the vertical rise divided by the horizontal distance to the point, not by the depth along the view axis. That second divisor is the whole difference between a cylinder and a plane, and it is one character in the source.

Everything the surface does follows from it. Horizontal scale is even, because equal turns of the head produce equal steps in u regardless of where the head is pointing. Vertical lines stay vertical, because a vertical world line has constant azimuth and so constant u. Horizontals bow, because a horizontal line at eye level runs off to two vanishing points that the azimuth coordinate places at u = ±π/2, and the line between them cannot be straight in a coordinate that is an angle.

The bow is measurable, and it is the first number this essay puts on the table. A ground line eleven metres either side of the view axis and six and a half metres in front departs from its own chord by 5.9% of that chord. On a flat plane the same line departs from its chord by nothing at all — the measurement returns zero to the last bit, which is what an exactly preserved property looks like when it is measured rather than asserted.

Three hundred and sixty degrees, and what the plane does instead

The reason to accept a bow is that the cylinder has no width limit. Its half-width is θ/2 — linear in the field of view, without an asymptote — so a full turn is a picture 2π focal lengths wide and nothing goes wrong at any point in it.

How wide the picture gets as the field of view opensOn a flat plane the picture's half-width is tan(θ/2): it multiplies by 6.6 between 120° and 170° and is unbounded at 180°. On a cylinder it multiplies by 1.42 over the same range and keeps going past 180° without incident.0246850100field of view across the picture (degrees)half-width of the picture, in focal lengthsplanecylinderstereographicequidistantcut off at eight focal lengthsthe plane crosses it at 166°
Fig. 2 Half-width of the picture against field of view. Between 120° and 170° the flat picture multiplies its width by 6.60 and the cylinder by 1.42. The flat curve leaves the top of the frame; the cylinder’s does not, and continues past 180° with nothing to mark the passage.

The comparison is worth making concretely, because “the plane cannot do 180°” is usually said as though the failure arrives suddenly at the end. It does not. At 120° the flat picture’s half-width is 1.73 focal lengths; at 150° it is 3.73; at 170° it is 11.4. Well before the asymptote the flat picture has become a shape in which the central subject occupies a small fraction of the sheet and the corners occupy most of it, which is a picture nobody would print and is the honest reason wide rectilinear photographs stop at about 120°.

The cylinder over the same range goes from 1.05 to 1.31 to 1.48. There is nothing to notice.

Why a panorama has to be turned about one point

There is a practical fact hiding in the first paragraph, and it is the site’s premise arriving in a place nobody expects it.

A cylindrical panorama is a picture, which means it is a record of directions from one point. A camera turned on an ordinary tripod does not rotate about one point: it rotates about the tripod screw, and the lens’s entrance pupil — the point light appears to converge on, which is the actual centre of projection — sits some centimetres in front of that. So each frame is taken from a slightly different place, and the frames are not views of the same scene from the same point but views from a small circle of points.

The consequence has a name that panorama photographers use without connecting it to projective geometry: parallax. Two objects at different depths that lined up in one frame do not line up in the next, and no amount of warping will make the two frames agree, because there is no single picture that both are views of. The stitch shows a doubled railing, or a lamp-post with a kink in it, or a foreground that will not meet itself.

The cure is to move the camera back on the tripod until the entrance pupil is over the axis, at which point every frame really is taken from the same point and the frames differ by a pure rotation. A pure rotation of the eye changes which directions are recorded and nothing else, so the frames become pieces of one picture and can be laid onto any surface at all — cylinder, sphere, or back onto a plane for a narrow crop.

This is the strongest practical statement the site’s premise makes. A picture is a projection from a point; two pictures from the same point can be combined into one and two pictures from different points cannot, however close together the points are. The number of centimetres of parallax that is tolerable is a question about how far away the nearest object is, and it is the same arithmetic as everything else here — an object at two metres seen from two points five centimetres apart moves by 1.4° relative to the background, which on a 690-pixel picture 40° wide is 24 pixels, and 24 pixels of doubled railing is visible from across a room.

The stretch it pays instead

An even horizontal scale and unbounded width are not free. What the cylinder gives up is shape.

At elevation φ above the horizon, the cylinder magnifies the horizontal direction by 1/cos φ and the vertical direction by 1/cos²φ. The ratio of the two — the anisotropy, the amount by which one direction is stretched more than the other — is therefore sec φ, exactly. A shape 25° above the horizon is 10% taller than it should be; one at 45° is 41% taller; one at 60° is doubled.

That is the vertical stretch anybody who has stitched a panorama has seen, and it is why cylindrical panoramas are cropped to a modest band of elevation and why the format goes to pieces if there is anything interesting overhead.

How unequally each surface stretches the two directionsStereographic is the flat line at 1: every direction is stretched by the same factor everywhere, which is what conformality means. The cylinder and the equirectangular surface share the curve sec φ exactly, though their area behaviour differs.0246020406080angle off the optical axis (degrees)anisotropy — how much more one direction is stretched than the otherplanecylinderstereographicequidistantequal-areaequirect.measured by differencing on the spherea flat line is a preserved quantity
Fig. 3 Anisotropy against angle off the optical axis, sampled on a diagonal rather than along the horizon — because the cylinder’s distortion is entirely a function of elevation, and a sweep along the equator would find none of it. Stereographic is the flat line at 1. The cylinder and the equirectangular surface lie exactly on top of each other.

Two surfaces with one curve

That last observation is the essay’s second finding, and it was not expected.

The cylinder and the equirectangular surface are always presented as different things. The first is what a stitching program produces from a rotating camera; the second is what a 360° camera writes to a file, and what any spherical panorama is stored in. The cylinder’s vertical coordinate is a tangent of the elevation and unbounded at the poles; the equirectangular surface’s is the elevation itself, bounded, so it can hold the whole sphere and the cylinder cannot.

They have identically the same anisotropy. Both stretch by sec φ, at every elevation, to fourteen digits.

The reason is short once seen. On the sphere the metric is cos²φ dθ² + dφ². The equirectangular surface takes u = θ, v = φ, so it magnifies the horizontal by sec φ and the vertical by 1, and the ratio is sec φ. The cylinder takes u = θ, v = tan φ, so it magnifies the horizontal by sec φ and the vertical by sec²φ, and the ratio is sec φ again. The cylinder is the equirectangular surface with the vertical axis stretched by a function of elevation alone — and stretching one axis by a function of that same axis leaves the ratio of the two magnifications untouched at every point.

What separates them is area, not shape. The cylinder’s area scale runs over a factor of 1.34 across the field drawn here; the equirectangular surface’s over 1.10. And the equirectangular surface reaches the pole while the cylinder never does. Two surfaces, one distortion of shape, different everything else — which is a good reason to state which property is being talked about before saying that two projections differ.

Where the cylinder beats a flat picture, and where it does not

There is a field of view at which the two swap places, and it is worth locating because it is much lower than the folklore suggests.

Judged on shape at the frame edge, the flat plane is better than the cylinder up to about 60°. At 60° across, a flat picture’s worst anisotropy over a fan reaching 25° in elevation is about 1.15 and the cylinder’s is 1.10 — close. At 90° across the flat plane is at 1.41 and the cylinder still at 1.10. At 120° the flat plane is at 2.00 and the cylinder is unmoved, because widening a cylindrical picture does not change its anisotropy at all: the anisotropy depends on elevation and not on azimuth, so the two-hundredth degree of azimuth is treated exactly like the first.

That property is the cylinder’s real advantage and it is not the one usually named. It is not that the cylinder distorts less; at low elevations it distorts more than a narrow flat picture. It is that the cylinder’s distortion does not depend on how wide the picture is. A flat picture gets worse toward its own edges, so a wider one is worse everywhere near the sides; a cylindrical picture is exactly as good at 175° of azimuth as at 5°.

One room at 190° across, cast onto six picture surfacesEach panel holds the same angular width of the same scene. The flat plane keeps every straight line straight and cannot hold this field of view at all; the five curved surfaces bend the ground lines by 3.5% to 6.0% of their own length.no picture at 195°the plane is unbounded at 180°plane — bend 0.0%cylinder — bend 6.0%stereographic — bend 3.5%equidistant — bend 4.5%equal-area — bend 5.1%equirect. — bend 5.7%195° across in every panelsame scene, same angle, six surfaces
Fig. 4 The same room at 190° across. The flat panel refuses: past 164° the picture is a smudge at the centre of an empty frame, which is the surface’s real behaviour rather than a limitation of the drawing. The five curved panels are unaffected — the cylinder at 190° is not doing anything it was not doing at 90°.

The bow, and what to do about it

A reader who has followed this far has one objection left, and it is the right one: bowed horizontals look wrong. A cylindrical panorama of a street has a pavement that curves up at both ends, and no amount of arguing that the surface is a choice makes that look like a street.

There are two honest answers and neither is that the reader is mistaken.

The first is that the bow is only visible because the picture is being looked at flat. A cylindrical picture is correct when it is viewed wrapped around a cylinder, with the eye on the axis — which is what a painted panorama rotunda is, and it is why the nineteenth-century ones worked and why photographs of them do not. Unrolled onto a page, a cylindrical picture is being looked at from the wrong shape, in exactly the way a flat picture looked at from the wrong distance is being looked at from the wrong place. The site’s premise extends: a picture is correct from one point on one surface, and unrolling changes the surface.

The second is that the bow can be moved. A world line through the cylinder’s axis — anything running directly toward or away from the viewer, and anything vertical — is straight in the picture. Every other line bows, by an amount that grows with how far it passes from the axis. So a panorama composed so that its important lines pass near the viewer has very little visible bow, and one composed with a long horizontal edge far off to one side has a great deal. That is a compositional fact with a computable basis, which is a better thing to hand a photographer than a rule about not using panoramas indoors.

The same 100° view, projected onto a plane and onto a cylinderOn the plane every straight line stays straight (1e-13 px of bend) and the edges stretch; on the cylinder the stretch is even and straight lines bow by up to 652 px.flat picture plane — straight lines stay straightcylindrical picture surface — even stretch, bowed linesone scene, two picture surfacesneither is the distorted one
Fig. 5 The same scene on both surfaces, at a field of view wide enough for the difference to matter. The flat panel keeps every line straight and stretches at the edges without bound; the cylindrical one keeps the stretch even and bows every horizontal that does not pass through the axis.

What the fitted conic says about the bow

The hero figure of this essay does something that needs explaining, because it is a measurement made with an instrument built for a different purpose.

The site already fits general conics — Ax² + Bxy + Cy² + Dx + Ey + F = 0 — because the image of a circle on the ground is an ellipse whose centre is not the image of the circle’s centre, and measuring that gap needed a fit. That machinery is handed the image of a great circle here, and asked what kind of curve it is.

Under stereographic the answer is unambiguous: the fit comes back a circle, with |A − C| + |B| at 4 × 10⁻¹⁰ of the fit’s own scale. Under a flat plane the answer is equally unambiguous the other way: the fit degenerates to a straight line, which is what a gnomonic projection does to every great circle. Under the cylinder the fit reports 1.3 — neither, by a wide margin.

That “neither” is the honest description of a cylinder’s bow and it is worth having. The curve a straight world line makes on an unrolled cylinder is not an arc of a circle, not a parabola, not any conic; it is a curve of the form v = a sec(u − b), which is what a plane through the eye cuts out of a cylinder. Illustrators approximating a panoramic bow with a circular arc are approximating, and the approximation is good near the middle and poor at the ends.

The reason to run the fit at all, rather than say all this, is that the same fit gives three different answers on three surfaces and every one of them is correct. A measurement that reports the same thing whatever it is shown is not measuring; one that separates a circle from a line from neither, using no knowledge of which surface it was handed, is.

Straight, or conformal — the corner that is emptySix picture surfaces plotted by how much they bend a straight line (across) against how far they are from preserving shape (up). The plane sits on the left edge and the top; stereographic on the bottom and the right. Nothing sits in the bottom-left corner, and by Beltrami's theorem nothing can.straight AND conformal — empty10⁻⁷10⁻⁶10⁻⁵10⁻⁴10⁻³10⁻²10⁻¹10⁰10⁻⁷10⁻⁶10⁻⁵10⁻⁴10⁻³10⁻²10⁻¹10⁰10¹10²bend of a straight line, as a fraction of its own chorddeparture from conformal (degrees, or % of anisotropy)planecylinderstereographicequidistantequal-areaequirect.sampled over a 115° fanlower left would be a surface with no cost
Fig. 6 Where the cylinder sits against the other five. Well away from the left edge, because it bends straight lines more than anything here, and well away from the bottom, because its sec φ anisotropy is not conformality.

What the cylinder is for

The summary is short and it is the reason this surface, of all the curved ones, is the one in general use.

A cylinder is the surface for a picture that is wide and not tall. It costs nothing in azimuth, at any width, up to a full turn and beyond. It costs sec φ in elevation, which is negligible for the first fifteen degrees and intolerable past forty-five. It keeps verticals vertical, which matters more than almost anything else for architecture, because a leaning building reads as a mistake in a way that a bowed pavement does not — which is the three-point case, and the reason architectural photographers avoid it.

And it is the only surface here whose defect a viewer can be trained out of. The bow of a long horizontal is a systematic, low-frequency curve; the eye accepts it after a few pictures. The vertical stretch at high elevation is a change of proportion in a recognisable object, and the eye never accepts that at all.