Light and mirrors

Where shadows vanish

The shadows of parallel posts under the sun meet at a point, and that point must lie on the horizon. Under a lamp they meet at the lamp's foot instead. Both are checkable in any photograph, and a picture whose shadows fail the check was not lit by anything.

Worth reading first: A shadow is a second projection.

Six posts stand in a row, vertical, on level ground, in sunlight. Their shadows are parallel to each other in the world, because the sun’s rays are parallel and the posts are.

In the picture they converge. They must, because parallel world lines converge to a vanishing point, and shadow lines are world lines like any other.

Where they converge is determined, and it is worth knowing because it is checkable in a photograph with nothing but a straightedge.

Six posts in sunlight from 34°The shadows are parallel in the world, so in the picture they meet at one point on the horizon — found from the drawn shadows to 3e-13 px.horizonshadows meet at x = -58, off the frameon the horizon, as it must be
Fig. 1 Six posts and their shadows. The vanishing point is found by least squares from the drawn shadows, with the residual reported; it agrees with the vanishing point of the sun’s ground direction and it lies on the horizon.

Why it is on the horizon

The shadows lie on the ground, and their direction is the sun’s direction projected onto the ground — a horizontal direction.

The horizon is the image of all the ground plane’s points at infinity, which is to say the vanishing points of all horizontal directions. The sun’s ground direction is one of them. So its vanishing point is on the horizon.

Measured on the site’s figures, the drawn shadow lines meet at a point whose residual is under 10⁻⁶ px, and that point sits on the horizon to within 10⁻⁶ px as well. Both numbers are checks rather than illustrations: a construction that put the shadows’ meeting point anywhere else would be constructing shadows for a light source that is not at infinity.

Six posts in sunlight from -42°The shadows are parallel in the world, so in the picture they meet at one point on the horizon — found from the drawn shadows to 4e-12 px.horizonshadows meet at x = 2066, off the frameon the horizon, as it must be
Fig. 2 The same six posts with the sun on the other side. The shadows are still parallel in the world, so in the picture they still meet at one point on the horizon — found from the drawn shadows to 4 × 10⁻¹² px. Changing the bearing walks the point along the horizon and never off it, which is the whole content of the rule.

The lamp case, which converges somewhere else

Under a point lamp the shadow lines are not parallel in the world. They radiate from the point on the ground directly below the lamp.

So they do not have a vanishing point at all — they have a genuine common point, at a finite place in the scene, and its image is the image of the lamp’s foot. It is not on the horizon and there is no reason for it to be.

That gives an immediate diagnostic for any picture with shadows in it.

Shadow lines converging on the horizon: the light is at infinity. Sunlight, or a source far enough away to count.

Shadow lines converging somewhere below the horizon: a local light source, and the convergence point is directly below it.

Shadow lines converging above the horizon: the light is behind the camera and below the horizon — a low sun in front of the viewer casts shadows that converge to a point on the horizon on the far side, which is the case that produces shadows running toward the viewer.

Shadow lines not converging at all: more than one light source, or a picture whose shadows were not constructed.

The altitude and the length

The sun’s height above the horizon fixes how long the shadows are, and the relation is a cotangent.

A post of height h with the sun at altitude α casts a shadow of length h·cot α. At 45° the shadow equals the height. At 10° it is 5.7 times the height. As the sun approaches the horizon the shadow grows without bound, which is why late-afternoon shadows run across whole fields.

Shadow length against the sun's elevationA 1 m post casts a 1 m shadow at 45° and a 5.7 m shadow at 10°. The curve is a cotangent and it has no upper bound.024620406080elevation of the sun (degrees)length of the shadow of a 1 m post (m)45° — shadow equals heightcot of the elevationunbounded as the sun sets
Fig. 3 Shadow length against solar altitude, for a 1 m post. The curve is a cotangent, it passes through 1 m at 45°, and it has no upper bound.

The altitude is also recoverable from a picture. Given the shadow’s vanishing point on the horizon and the vanishing point of the light rays themselves — found from the lines joining each post’s top to its shadow tip — the angle between them, converted through the camera’s focal length, is the sun’s altitude.

That requires the focal length, which a picture with anything rectangular in it will supply. So a photograph can be asked what time of day it was taken, in the sense of what the solar altitude was, using nothing but its own contents.

Shadow length against the sun's elevationA 2 m post casts a 2 m shadow at 45° and a 11.3 m shadow at 10°. The curve is a cotangent and it has no upper bound.01020204060elevation of the sun (degrees)length of the shadow of a 2 m post (m)45° — shadow equals heightcot of the elevationunbounded as the sun sets
Fig. 4 The cotangent on a taller post. A 2 m post casts a 2 m shadow at 45° and an 11.3 m shadow at 10°, and the curve has no upper bound — the post’s height is a multiplier and the sun’s elevation is the whole of the shape. That is why a shadow length is only a measurement once the post is known.

Forensic geometry

That combination — shadow direction and shadow length, both readable from the picture — is a working technique.

Consistency checking. Every shadow in a scene lit by one source must be consistent with one light position. Extending the shadow lines and checking they are concurrent, and checking the ray lines are concurrent too, tests that. A composite image assembled from two photographs taken at different times fails it, usually badly, and this is one of the standard tests for image manipulation.

Locating the light. For a lamp, the convergence point of the shadow lines is the foot and the convergence point of the ray lines is the lamp itself. Two points, both constructed with a straightedge, and the lamp’s height follows.

Timing. Solar altitude and azimuth together fix the time of day and season for a known latitude and longitude, so a photograph with shadows in it carries a timestamp that is hard to fake and easy to check.

Checking a rendering. The same test applied to computer-generated imagery finds shadows that were painted rather than cast, which is a common shortcut and one that this geometry sees immediately.

Why illustrators get it wrong

Constructed shadows in drawings fail the test constantly, and the failures fall into a few types worth naming.

Parallel shadows in a perspective drawing. Drawing the shadows of a row of posts parallel to each other on the page, because they are parallel in the world. They should converge, at the same rate everything else does.

That one is worth pricing, because it is the commonest and it turns out to be grossly visible rather than subtle. If the shadow direction’s vanishing point sits DD pixels from the posts and the posts span SS pixels across the picture, the correct shadow directions differ from one another by about S/DS/D radians — so the far ends of shadows drawn \ell long are displaced by

SD.\ell\,\frac{S}{D}.

For a vanishing point 800 pixels away, posts spanning 400, and shadows 150 pixels long, that is 75 pixels — half a shadow’s length, and unmissable once a straightedge is laid along two of them. The error is zero for a single shadow, which is why a drawing with one object never gives itself away, and grows linearly with how far the objects are spread across the picture.

It also disposes of the belief that sunlight is the exception. The sun’s shadows are parallel in the world, which is exactly the condition that makes them converge in the picture — like any parallel family. They stay parallel on the page only when their world direction happens to be parallel to the picture plane, which is one azimuth out of all of them, and a drawing that assumes it has assumed the one case rather than the general one.

Shadows converging to the object’s own vanishing point. A plausible-looking error: running the shadows to a point already in use. The shadow direction is a different world direction from any of the object’s edges, so it has its own vanishing point, somewhere else on the horizon.

Shadow length inconsistent with the light height. Drawing a shadow that looks about right rather than constructing it. Since the length is h·cot α and the same α applies to everything in the scene, one shadow drawn by eye makes all the others wrong relative to it.

Shadows and highlights lit from different directions. The light position determines both, and they are often drawn by different reasoning.

Each of these produces a picture that reads as slightly unconvincing without anyone being able to point at the cause, which is the recurring condition of constructions that were never measured.

The relation to the object’s own vanishing points

One structural point that ties the family together.

A scene lit by the sun has, among its directions: the three edge directions of any box in it, the sun’s ray direction, and the sun’s ground-projected direction. Each has a vanishing point. Two of them — the shadow direction and any horizontal edge direction — are on the horizon; the ray direction generally is not.

They are not independent. The ray direction, its ground projection and the vertical form a right-angled triangle in the world, so their three vanishing points satisfy the same orthogonality relation the recovery uses. Which means the sun’s position in a photograph over-determines itself, and the over-determination is a consistency check available for free.

That is the same pattern as everywhere else on this site: a quantity computable two ways, with the agreement as the measurement and the disagreement as the content.

Constructing a shadow from the vanishing points alone

The two vanishing points — one for the light rays, one for the shadow directions — are all a construction needs, and having them makes the whole business mechanical.

For a vertical post: draw the line from the shadow-direction vanishing point through the post’s base, and the line from the ray vanishing point through the post’s top. Where they cross is the tip of the shadow.

For a horizontal edge: its shadow is a straight line, so only its two endpoints need constructing and the shadow is the join.

For an edge lying on the ground: it is its own shadow, which sounds trivial and is the step people forget, producing shadows detached from the objects casting them.

For a sloping edge: its shadow is again straight, from the shadows of its two ends, and its direction has its own vanishing point that is neither of the two above. That third point is on the horizon if and only if the sloping edge’s shadow direction is horizontal — which it always is, since all shadows lie on the ground — so a sloping edge’s shadow vanishing point is on the horizon too, at a different place from the vertical edges’ one.

The whole apparatus is two points and a straightedge, and once they are placed nothing is judged.

Why the sun is treated as a point

The sun subtends about half a degree, which is not a point, and treating it as one is an approximation worth being explicit about.

The consequence of the finite size is the penumbra: the region reached by part of the sun’s disc and not all of it. Its width grows with the distance from the occluder to the receiving surface, at about 1/115 of that distance — so a post’s shadow is sharp at its base and its tip is soft by a centimetre for every metre of shadow length.

That is a large effect for a tall building and invisible for a pencil, which is why building shadows have soft ends and desk objects do not. It has nothing to do with the geometry of where the shadow’s centre line goes, which is what this essay computes, and it is why a shadow can be constructed as though the sun were a point and then softened as a separate operation.

The same reasoning applies to a lamp, more strongly, because a domestic lamp is angularly much larger than the sun at ordinary distances and its shadows are correspondingly softer. A picture with hard-edged shadows from a nearby soft source is geometrically correct and physically wrong, which is a distinction worth being able to make.

The one case where the horizon rule fails

The claim that shadow lines converge on the horizon depends on the shadows lying on a level ground plane, and on sloping ground it fails.

Shadows on a hillside are still straight and still parallel to each other in the world — the sun’s rays are still parallel and the hillside is still a plane — so they still converge to a vanishing point. But that vanishing point is the image of a direction lying in the hillside’s plane, not the ground’s, so it sits on the hillside’s horizon, which is a different line.

The two horizons meet where the two planes’ common direction is, which is the horizontal direction along the slope. A picture containing both level ground and a slope therefore has two horizons and two shadow vanishing points, and getting them confused is a reliable way to produce shadows that read as sliding off the hill.

This is the same structure as every family of parallel lines having its own vanishing point — nothing new is happening, and the only trap is assuming that “the horizon” is unique when what is unique is the horizon of a given plane.

Shadows as a depth cue

Beyond the checking, the shadow’s vanishing point does something for a picture that nothing else does as cheaply.

A shadow attaches an object to the ground at a specific place. Without one, an object drawn in a scene has an ambiguous position: it could be small and near or large and far, and nothing in the picture decides. The horizon-crossing rule resolves it for objects standing on the ground, and a shadow resolves it for everything else.

The resolution is quantitative. Given the light position, the length of a cast shadow fixes the object’s height above the ground, and the shadow’s position fixes its footprint. So a shadow carries two numbers that the object’s own image does not.

That is why removing shadows from a rendering makes objects appear to float even when they are drawn in exactly the right place, and why adding a contact shadow — a small dark patch at the point of contact — is enough to anchor an object even when the rest of the shadow is omitted. The contact point is where the shadow and the object coincide, and it is the single most informative point in the whole construction.

Two lights, and what the check reports

Most interiors are lit by more than one source, and the concurrency test extends to that case in a way that is worth knowing because it is what makes the test practical rather than academic.

With two lamps, every object casts two shadows. The shadow lines of all objects belonging to the first lamp are concurrent at the first lamp’s foot; those belonging to the second are concurrent at the second’s. So the shadows sort themselves into two families, and each family passes the test on its own.

That is a stronger result than it sounds. It means the number of light sources in a scene can be counted from the shadows, their feet located, and each shadow attributed to its source — all with a straightedge, and all from the picture.

Where it fails is with extended sources and with bounced light, which produce shadows too soft to have a definable edge, and with a scene lit mostly indirectly, which has no distinct shadows at all. Those are the cases where the geometry has nothing to say, and it is worth being able to recognise them rather than forcing the construction onto a picture that does not have the structure for it.

Why the shadow’s vanishing point is worth finding

A last practical note, because the construction has a use beyond checking.

Given one correctly drawn shadow, the shadow direction’s vanishing point follows — join the object’s base to the tip of its shadow and extend to the horizon. Every other shadow in the picture then follows from that one point plus the light ray vanishing point, with no further judgement anywhere.

So the whole shadow scheme of a drawing is fixed by two points, and the two points are fixed by one shadow. Drawing that first shadow carefully and constructing the rest is both faster than drawing them all by eye and consistent by construction, which is the combination that almost never happens in this subject.

The lamp, from the shadows aloneThe two intersections are the light and the point below it. Nothing about the lamp was given to the construction — it is shown three posts, three shadow tips and the camera's own horizon — and the recovered position is 1e-12 mm from the truth. The light's foot sits 351 px below the horizon, which is what says it is a lamp and not the sun.the shadow lines meet below the horizon — a lamp in the roomhorizoncorrect from 25 cm, at 160 mm wide3 posts · foot 351 px below the horizon
Fig. 5 What the point is worth once it has been found. Three posts, three shadow tips and the camera’s own horizon are all the construction is shown, and the two intersections it returns are the light and the point on the ground directly below it. Nothing about the lamp was given to it.

The same convergence, read backwards

This essay finds where a set of shadows converges, given the light. The expansion phase’s metrology field does the reverse — it takes the convergence as data and asks what the scene was — and the two are worth holding together because the second is the first with the unknowns swapped.

A bundle of world-parallel lines in a photograph has a vanishing point, recoverable by least squares with a residual that says whether they really were parallel. Two such points determine the horizon. The horizon plus the vertical vanishing point turn a cross-ratio along any standing object into that object’s height, in units of the photographer’s own eye height.

Shadows are a particularly good source of such bundles, and they are underused. A row of posts under the sun casts shadows whose directions are parallel in the world, so their images converge, and the convergence gives a horizontal vanishing point for free — from a set of lines that are usually longer and better separated in the picture than anything on the objects themselves.

The degenerate case this essay identifies applies unchanged. A row strung out along the direction the shadows run gives collinear shadows, no vanishing point exists, and the fit is singular. What is a curiosity when drawing is a failure mode when measuring, and it is the same fit that reports it.

What links here

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

Reads more easily once this is understood

Essays that name this one as worth reading first.

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.

Forensic geometryHorizonLight directionResidualshadow vanishing pointSolar altitudeVanishing point