Have you ever wondered why lens hoods are often circular when the recorded image is rectangular? This in turn points to an even bigger question: what is the purpose of lens hoods?
The image that is formed by a lens is circular, which is hardly surprising given that lenses themselves have circular symmetry about their optical axis (an imaginary line running right through the centre of the lens from front to back, and beyond). Sensors, on the other hand, are rectangular and use only part of the projected image circle.
Geometrically minded readers will realise that the percentage of the image circle that is recorded varies inversely with the "unsquareness" of the rectangle: a highly rectangular format would use a low percentage of the image circle whereas a square format uses the maximum that quadrangle can provide. The only way to cram more of a scene in the picture is to switch to a circular image (as is done with circular "fisheye" lenses).
In an ideal world, only light that contributes to the image would be allowed to enter the lens as other, non-image-forming, light can cause internal reflections that create flare and lower the image contrast. So it stands to reason that a lens should be rectangular to match the shape of the sensor format.
Except that things aren't quite so simple: the problem is that the angle-of-view recorded on a sensor varies with the linear dimensions of the sensor.
In other words, if you take a landscape picture using a (horizontal) rectangular-format sensor then the picture will be wide (and capture a wider angle-of-view) across the horizon than it does looking up into the sky. In fact the widest angle-of-view is captured across the diagonal of the sensor, where its dimension is the longest.
These different angles-of-view impose different demands on the lens hood. To appreciate this, it is easiest to forget the different dimensions and think instead about different focal length lenses, as shown in the diagram below.
Lens hood design features for simple (single-element) lenses.
A long focal-length lens (top) has a relatively narrow angle-of-view and a modest lens hood does not even touch the rays of light that go to the extreme edges of the sensor. In other words, this lens hood is not blocking all of the non-image-forming light.
A short focal-length lens (middle) has a wide angle-of-view and the same modest lens hood now skims the rays of light that go to the extreme edges of the sensor. This is the optimum lens hood for this simplified arrangement.
Bearing in mind that a narrow angle-of-view can accommodate a longer lens hood, and that the angle-of-view always varies in different directions across a sensor even for a fixed lens, it now becomes clear why lens hoods can have longer sides at the top and bottom where the angle-of-view is narrowest. Similarly, lens hoods have their shortest height not at the side but across the part of the hood that corresponds with the diagonal of the sensor.
So why are these oddly shaped lens hoods confined to wide-angle lenses? The answer is that the difference in height varies much lens as the focal-length gets longer and it simply ceases to become worth the effort of creating specially shaped lens hoods when cylindrical designs would do just as well in practice.