About
This is a growing collection of illustrated essays about perspective and the other drawing systems. Each takes a single idea and draws it until the argument is visible — and every point in every figure comes out of a camera with a focal length rather than out of a line run to a vanishing point placed by eye.
Why a camera rather than a construction
A perspective figure is normally constructed. A horizon is drawn, two vanishing points are put on it where the composition wants them, edges are run to them, and the remaining edges are placed by judgement. The method is centuries old, it is what every book on the subject teaches, and it is sound in the hands of someone careful.
It has a failure mode with no symptoms. The construction has a free step — where the far vertical edges of the box go — for which no printed method supplies a construction, because doing it properly needs a measuring point the method never introduces. The picture that results is a picture of a box. Which box is decided entirely by that free step, and nothing in the drawing says which one it was.
That is measurable rather than arguable. Given the two vanishing points and a principal point, the focal length follows; given the focal length, the drawn quadrilateral can be back-projected and the solid it depicts read off. Doing that to the taught construction gives the result the essays are built on: place the two far edges symmetrically and you get a cube for free, and eight points of asymmetry — a difference invisible in the drawing — gives a box whose depth is 1.4× shallower than its width.
So on this site there is no construction step. There is a camera with an eye, a target, a focal length and a principal point; a scene of world points in metres; and a projection. A picture that no camera could produce cannot be drawn, because there are no coordinates to draw it from.
Where the picture is correct from
The reason for insisting on a real focal length is that it answers a question the whole subject leaves out. A picture is a projection through a centre. Scale the picture to the width it is actually displayed at and the centre scales with it, and the scaled focal length is the distance the viewer's eye has to be from the page.
Nothing about the scene enters that calculation. The correct viewpoint is a property of the picture and its printed size, not of what it depicts. Shown 160 mm wide, a 40° picture is correct from 22 cm; a 90° picture from about 8 cm, which is closer than most people can focus.
That single number disposes of the most-asked question in the subject. A wide-angle photograph does not distort faces. It is a correct rectilinear projection, its edge stretch is exactly 1/cos θ off axis — 3% at 28°, 41% at 90° — and every bit of that stretch disappears if the picture is viewed from the point it was made for. Nobody views it from there, which is a fact about how photographs are looked at rather than a fault in the lens.
Every figure on this site states its viewing distance in the caption strip, alongside the width the figure was assumed to be shown at, so a reader on a phone or a projector can redo the arithmetic. The assumption is stated because it cannot be measured from here, and hiding it inside a constant would make the claim look more certain than it is.
The camera is recovered from the picture
A projection that only ever runs forwards proves nothing about itself. So the machinery runs
backwards as well, and the two halves are kept apart in the code: lib/projective.js
never sees the scene or the camera. It is given the drawn line segments and nothing else.
From those it finds three vanishing points — each as the least-squares meet of a bundle of four drawn edges, with the residual reported so a bundle that does not really share a point cannot pass quietly — takes the orthocentre of the triangle they form as the principal point, and gets the focal length from the relation that two orthogonal directions must satisfy. Each of the three pairs gives a focal length independently.
On a box drawn from a known camera the three agree to within 3 × 10⁻¹⁶ of each other and the recovered focal length matches the true one to about 10⁻¹⁵ relative, with the principal point out by 2 × 10⁻¹² of a pixel. Those numbers are a statement about the geometry, because the only thing that crossed from one half to the other was twelve line segments.
Two routes, wherever there are two
- The measuring-point construction is drawn and then checked against the depths the camera actually produces — the classical construction and the projection, agreeing to 8 × 10⁻¹⁴ of a pixel over six divisions.
- A reflection is computed by reflecting the scene and photographing it, and by reflecting the camera and photographing the original scene. They disagree by 906 px and agree to 6 × 10⁻¹⁴ once one image axis is reversed, which is what a mirror reversing handedness looks like written down.
- A vanishing point is computed in closed form and found again by marching a point along the direction until its image stops moving. The test is not that the two are close but that the error falls by exactly ten when the marching distance is multiplied by ten.
- The edge stretch of a wide frame is measured from drawn spheres and compared with 1/cos θ at the measured angle off axis.
What broke while this was being built
Two of the site's own checks failed in ways worth recording, because both were checks that looked right and measured nothing.
The first: comparing the cross-ratio of four consecutive divisions in a receding row against the value four equally spaced points must have. That test gives the equal-steps-by-eye method a perfect score. It has to — four points equally spaced in the picture have the same cross-ratio as four points equally spaced in the world, because the cross-ratio of 0, 1, 2, 3 is 4/3 either way. The invariant is necessary and not sufficient, and a check that only knows it is necessary will certify a wrong construction. Bringing the vanishing point in as the fourth point fixes it, and then all three by-eye methods fail.
The second: the figure that measures what the taught cube construction depicts reported a side ratio of exactly 1.000 at every setting, which looked like a bug. It is a result. Moving both far edges together keeps the drawing symmetric, and symmetry forces a square. What decides the solid is the difference between the two by-eye placements, not their common value.
Where this stops
This is a geometry of pictures, not an account of seeing. It says where a point goes, what survives the journey, and where a viewer must stand for the picture to be a projection of anything. It says nothing about perception. The eye is not a pinhole; it moves constantly, it has one sharp degree at the centre of a wide field, and pictorial depth cues compete with binocular ones that say truthfully that the picture is flat. A viewer at the wrong distance usually does not notice and is not troubled.
Nothing here reproduces an artwork. Where a painting is discussed, its geometry is reconstructed from a synthetic scene and the original is described in words. That is partly a licensing rule and mostly a methodological one: the projection is the content, and a photograph of a painting would add authority the argument has not earned.
The pinhole is an idealisation. Real lenses have radial distortion, which bends straight lines and is corrected for rather than modelled here; they have finite apertures and depth of field; and a photograph's projection centre is the entrance pupil rather than a point. None of that changes the geometry these essays are about, and all of it matters to anyone comparing a figure here with a photograph.
The viewing distances assume a display width. 160 mm, which is roughly what a figure occupies on a laptop. The arithmetic is given every time so it can be redone; the number itself is an assumption and is labelled as one.
Corrections are welcome and will be made. A picture drawn from an impossible camera looks like a picture, which is the entire reason this site computes rather than constructs, and the same courtesy applies to its own figures.