Light and mirrors

The shadow of a ball is a conic

A cone cut by a plane is a conic section — which is the definition of the phrase, not an analogy — and the shadow of a ball is exactly that cut. So the shadow closes or runs to the horizon depending on where the lamp is, and the condition is not what anyone guesses: it is that the lamp is above the top of the ball. The ball's distance appears nowhere in it.

Worth reading first: A shadow is a second projection · The circle whose centre moves.

A lamp is a centre of projection. That identification is the whole of a shadow is a second projection and it is what lets one piece of code draw both the picture and the shadows in it. Its consequences for a ball are more specific than the general statement suggests, and they are not the ones a reader expects.

The rays from the lamp that graze the ball form a cone. The shadow’s edge is where that cone meets the ground. A cone cut by a plane is a conic section — an ellipse, a parabola or a hyperbola — so the boundary of a ball’s shadow is one of those three, and which one is a fact about where the lamp is.

The shadow of a ball, under a lamp 1.60 m upThe lamp's tangent cone cuts the ground in an ellipse. The top of the ball is at 0.84 m and the lamp at 1.60 m: above that height the shadow closes, below it the shadow reaches the horizon, and the ball's distance from the lamp appears nowhere in the condition.the lamp is above the top of the ball — an ellipsecorrect from 22 cm, at 160 mm wideaxis ratio 0.3448 · discriminant -4.60e-1
Fig. 1 A ball on the ground under a lamp, with eight of the tangent rays drawn and the shadow’s edge computed as the section of the cone. At 1.6 m — well above the top of the ball — the section is an ellipse and the shadow closes.

The condition, and how simple it turns out to be

Write α\alpha for the cone’s half-angle, so sinα=R/D\sin\alpha = R/D with RR the ball’s radius and DD the distance from lamp to ball centre. Write δ\delta for the angle by which the cone’s axis descends — the angle below horizontal of the line from the lamp to the ball’s centre, so sinδ=(Lycy)/D\sin\delta = (L_y - c_y)/D.

The shallowest ray in the cone descends by δα\delta - \alpha. It fails to reach the ground when that is zero or negative, and both sines have the same DD underneath, so the DD cancels:

δα    LycyR\delta \le \alpha \iff L_y - c_y \le R

The shadow stops closing exactly when the lamp is level with the top of the ball. No distance appears in the condition. A lamp a hundred metres away and a lamp at arm’s length give shadows of wildly different sizes, positions and eccentricities, and both cross from closed to open at the same height — the height of the top of the ball.

That is worth a moment because it is not the intuition. The intuition is that a distant lamp behaves like the sun and so gives a bounded shadow whatever its height, and it does not: a distant lamp low down gives a shadow that runs to the horizon just as a near one does.

The shadow of a ball, under a lamp 0.70 m upThe lamp's tangent cone cuts the ground in a hyperbola. The top of the ball is at 0.84 m and the lamp at 0.70 m: above that height the shadow closes, below it the shadow reaches the horizon, and the ball's distance from the lamp appears nowhere in the condition.the lamp is below the top of the ball — a hyperbolacorrect from 22 cm, at 160 mm widehyperbola — the shadow does not close
Fig. 2 The same ball with the lamp below the top of it. The cone’s lowest ray now rises, so the shadow’s edge never lands and the section is a hyperbola — the shadow runs off to the horizon and the figure’s rays are the ones that do not come back.

The claim is checked the way this site checks things: the crossing is found by bisection on the fitted section’s own discriminant, without being told where to look, and it agrees with the closed form. And the absence of the distance is checked separately by putting three lamps at three distances, all at the critical height, and requiring the discriminant to be zero for all three.

The sun cannot do it

Take the lamp to infinity and the cone becomes a cylinder. A cylinder cut by a plane is always an ellipse — it has no unbounded sections at all unless the plane is parallel to its axis, which for sunlight would mean the sun on the horizon.

The shadow of a ball, in sun at 38°Sunlight round a ball is a circular cylinder, and a cylinder cuts a plane in an ellipse at every altitude — so the sun cannot make an open shadow. The minor axis is the ball's own diameter and the ratio of the axes is 0.6173, which is the sine of 38°.sunlight: a cylinder, so always an ellipsecorrect from 22 cm, at 160 mm wideaxis ratio 0.6173 · discriminant -1.52e+0
Fig. 3 The same ball in sunlight. Sunlight around a ball is a circular cylinder rather than a cone, so the section is an ellipse at every altitude and the shadow always closes. Its minor axis is the ball’s own diameter, whatever the sun does.

So here is a difference between a lamp and the sun that is qualitative rather than quantitative, and it is the sharpest one this site has found. Almost everything else about a distant lamp converges smoothly on the sun’s behaviour as the distance grows. This does not: for any finite lamp there is a height below which the shadow is unbounded, and for the sun there is none. The transition is at R/DR/D, which goes to zero and never arrives.

Reading the sun’s altitude off the shadow

The ellipse the sun casts has a property worth having on its own. The cylinder is circular with radius RR, so its section by the ground has minor semi-axis exactly RR and major semi-axis R/sin(altitude)R/\sin(\text{altitude}). The ratio of the two axes is therefore

minormajor=sin(altitude)\frac{\text{minor}}{\text{major}} = \sin(\text{altitude})

and the ball’s size divides out. A shadow twice as long as it is wide was cast at 30°. A shadow of any ball on any flat ground carries the sun’s altitude, needing no reference length and no ruler — only the ratio of two distances in the same picture.

The shape of a ball's shadow against the sun's altitudeThe curve is the sine and the four marks are conics fitted to sampled shadow outlines — they agree to 2e-15. Nothing about the ball's size is in it, so a photograph of any ball on any flat ground carries the altitude it was taken at.00.2500.5000.750120406080altitude of the sun (°)shadow's minor axis ÷ its major axiscurve: sin(altitude)fitted outlines agree to 2e-15
Fig. 4 The axis ratio against altitude. The curve is the sine; the marks are conics fitted to sampled shadow outlines, which never see the sun and agree with the closed form to 2e-15.

That is a round trip rather than a formula: the outline is sampled by casting the silhouette circle, a conic is fitted to the sampled points, its semi-axes come out of the fit, and the altitude is recovered from their ratio. Across five altitudes it comes back to nine decimal places, and the minor axis comes back as the ball’s own radius, which is the control — a fit that got the shape right and the size wrong would still return the correct altitude and would mean something quite different was happening.

How much of a ball a source lightsThe curve is (1 − R/D)/2 and the dots are a quadrature over the surface that tests each patch by whether it can see the source. A lamp 4 radii away lights 37.50% of the ball, not 50% — the half is the limit and nothing finite reaches it.0204051015distance from the source to the ball, in radiifraction of the ball's surface that is lit (%)one half — the source at infinity37.5% at 4 radiicurve: the closed form · dots: quadratureagreeing to 5e-4
Fig. 5 What the same cone says about the ball rather than about the floor: how much of the surface a source at a given distance lights. The tangency circle is one object and these are two readings of it.

The silhouette is not a great circle

One detail in the machinery deserves to be said out loud because it is the same fact the terminator rung is entirely about.

The set of points where the tangent rays touch the ball is a circle, and it is not a great circle. It lies at R2/DR^2/D from the centre, toward the light, with radius R1R2/D2R\sqrt{1 - R^2/D^2}. For the sun that offset is zero and the radius is RR: the silhouette is a great circle, as everyone assumes. For a lamp two radii away the offset is half the radius and the silhouette circle is only 0.866 of the ball’s radius across.

Casting that circle is what gives the shadow. Casting a great circle instead gives a shadow that is close and wrong, and the error grows exactly as the lamp comes in — which is the regime where the shadow is most interesting.

A 40 cm source, an edge, and the band betweenThe penumbra is 20.0 cm wide by the projection — the source's width times the receiver-to-occluder distance over the source-to-occluder distance — and 19.9 cm by counting how much of the source each point can see. The two routes share no arithmetic.source, 40 cmthe occluder's edgefraction of the source visiblepenumbra 20.0 cmprojection: 20.00 cmsampled: 19.90 cm
Fig. 6 What happens to the edge when the source is not a point. The boundary computed here is the umbral one; a real source of finite width replaces it with a band whose width is the source’s own image, and the geometry of the conic is unchanged inside it.

What the conic type is good for

There is a practical reading of all this, and it is about pictures rather than about balls.

A photograph or a painting containing a ball with a closed elliptical shadow says the light was above the top of the ball. If the shadow runs out of frame in a way that is widening rather than closing, the light was below it. These are checkable against everything else in the picture: the shadows of parallel posts must converge to a point, and that point must be on the horizon for the sun and below it for a lamp, and the ball’s shadow must be a section of a cone with its apex at the same light.

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. 7 The companion check on the same picture. Shadows of parallel verticals meet at a point, on the horizon under the sun and at the lamp’s foot under a lamp. A picture whose ball-shadow says lamp and whose post-shadows say sun was not lit by anything.

None of these is a subtle test and all of them are routinely failed by constructed images, because a shadow drawn by hand is drawn to look right rather than computed. The reason to put numbers on them is not to catch anybody out; it is that a claim with a number attached can be wrong, and “the shadow looks about right” cannot.

A box and its shadow, both projections from a pointThe rays from the lamp to the corners are the same construction as the rays from the eye to the corners — one operation, two centres.correct from 26 cm, at 160 mm wide34° across
Fig. 8 The machinery underneath, from the rung below: the shadow of a box, computed by the same projection the camera performs, with the lamp where the eye was. Nothing in this essay needed new machinery — only the observation that when the object is a ball, the projection’s own cone is the thing to look at.
A circle on the ground, and the two points that get called its centreThe image of the centre and the centre of the image ellipse are 14.6px apart — 4.0% of the ellipse's own width.centre of the ellipseimage of the centrecorrect from 22 cm, at 160 mm wideoffset 14.6 px
Fig. 9 A conic elsewhere in the site, for the comparison worth making. The image of a circle is a conic whose centre is not the image of the circle’s centre; the shadow of a ball is a conic whose centre is not the shadow of the ball’s centre, and for exactly the same reason.

Which conic, in terms a reader can check

The type is decided by the discriminant of the section, and the discriminant is a number in a computation. There is a version of the same statement that can be checked in a picture with no computation at all.

Ellipse. The shadow closes. Its far end is a curve that comes back, and the whole shadow is a bounded region of the floor. This is what a lamp well above the object gives, and it is what the sun always gives.

Parabola. The shadow’s two sides run away parallel — never meeting again, never diverging. This is the knife-edge case and it is not observable in practice, because a real lamp is exactly at the top of a real ball for exactly one lamp height.

Hyperbola. The two sides diverge and the shadow widens as it goes. A shadow that gets wider the further it runs is the signature, and it is not subtle at any distance.

So the three cases are distinguishable by eye and the boundary between them is a statement about the lamp’s height alone. That is unusually convenient: most consistency tests on a picture need a construction, and this one needs a look.

What the sun’s ellipse is doing, geometrically

The sun case is worth deriving rather than asserting, because the derivation says why the ball’s size drops out and the assertion does not.

Sunlight around a ball of radius RR is a circular cylinder of radius RR — every ray grazing the sphere is parallel to every other, so the tangent surface is a cylinder rather than a cone, and its cross-section perpendicular to the sun’s direction is a circle of exactly the sphere’s radius.

Cut a cylinder of radius RR by a plane at an angle. The section is an ellipse whose minor semi-axis is RR — the cut is at full width across the cylinder’s own width — and whose major semi-axis is RR divided by the sine of the angle between the plane and the cylinder’s axis. For the ground and the sun, that angle is the sun’s altitude.

So the minor axis is the ball’s diameter and the major is that divided by the sine, and the ratio of the two has no RR in it. That is why a shadow of any ball carries the altitude: the size cancels between the two axes because both are proportional to it.

The same cancellation is why the measurement is robust to something a reader might worry about. The ball need not be a sphere of known radius, need not be a known distance away, and need not have its own scale in the picture. Only the two axes of its shadow are needed, and only their ratio.

The five numbers, and which of them are readable

A conic has five degrees of freedom, and the point of using a ball rather than a post is that all five carry something.

Two go on position — where the shadow’s centre is on the floor, which locates the ball’s own position relative to the light and the ground.

Two go on shape — the axis ratio and the orientation. Under the sun the ratio is the sine of the altitude and the orientation is the azimuth, so those two numbers are the sun’s direction, read off the shadow with no reference length anywhere.

And one goes on size, which is the ball’s radius as scaled by the geometry — the one number that needs something else known before it means anything, since a picture of a large ball far away and a small one near by are the same picture.

Reading that list against a post’s shadow, which is a segment and carries two numbers, says why a ball is the right object to put in front of a light. A post gives the light’s direction and nothing else; a ball gives the direction, the position, the type and — with one length — the size.

The consistency test, written out

For a picture containing a ball, its shadow, and at least one vertical object with its own shadow, four conditions have to hold together, and each is checkable with a straightedge.

The ball’s shadow must be a conic — five points of its outline determine the conic and the rest of the outline must lie on it.

Its type must agree with the light’s height as read from the vertical object’s shadow: closed if the light is above the top of the ball, open if below.

The shadows of the vertical objects must converge to a single point, on the horizon under the sun and below it under a lamp.

And under the sun, the ball’s shadow’s axis ratio must be the sine of the altitude that the vertical’s shadow length implies.

Four conditions and one light. A picture that satisfies all four was lit by something; a picture that fails one was not, and which one it fails says what kind of mistake was made.

The one place the analogy strains

A shadow is a projection from the lamp onto the ground, and this essay has been treating the ball’s tangent cone as the object. That is a small sleight: the cone is not part of the scene, it is the boundary of the set of rays the ball blocks. What is projected is the silhouette circle, and the cone is the family of rays through it.

The reason it works out is that the projection of a circle from a point is exactly the section of the cone through that circle, so the two descriptions are the same object approached from either end. It is worth noticing only because the same substitution fails as soon as the occluder is not convex: a ring’s shadow is not the section of anything, and a shadow with a hole in it is not a conic. Convexity is doing quiet work, as it does in the hull the shadow of a box is, where a shadow drawn as a bow-tie went unnoticed for the whole life of a figure because nothing was asking whether the region was a region.

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. 10 The simplest measurement in the field, and the one this rung generalises: the length of a vertical’s shadow against the light’s height. A post gives one number; a ball gives a conic, and the conic carries the altitude, the type, and the size all at once.
A box over a reflecting floor, with the reflection computed twiceReflecting the scene and reflecting the camera disagree by 264 px and agree to 0e+0 px once one image axis is reversed — which is what a mirror reversing handedness looks like in numbers.grey: the reflectiontwo routes, agreeing to 0e+0 px after one flip
Fig. 11 The third use of one centre of projection. A mirror is a camera reflected, a lamp is a camera moved, and a ball in front of either draws a conic — which is why one file computes all of it.

The reason a ball is the right object to ask about is exactly that. A post’s shadow is a segment and a segment carries one number. A ball’s shadow is a conic, a conic has five, and the five are all readable — which makes a ball the most informative thing anybody can put on the ground in front of a light.

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.

centre of projectionConicDemonstrationHorizonline at infinityPoint lightshadow vanishing pointSilhouetteTangent coneTerminator