William Wordsworth's heart may have leapt up when he beheld a rainbow in the sky, but it is doubtful that he fully appreciated the poetic beauty of the physics behind what he was looking at.
The ancient Greeks pondered rainbows a good deal. Aristotle wrote that "the rainbow never forms a full circle, nor any segment greater than a semicircle" (which just goes to show that he had never witnessed one from an aeroplane). "There are never more than two rainbows at one time," he wrote (confirming that he had never seen a rare triple rainbow). "Each of them is three-coloured, the colours are the same in both and their number is the same, but in the outer rainbow they are fainter and their position is reversed."
Aristotle listed the colours of the rainbow as red, green and purple "though between the red and the green an orange colour is often seen" - which sounds odd to anyone brought up on the traditional seven-colour rainbow, though the choice of a number for the colours of the rainbow is arbitrary.
According to some sources, Newton's perception of the spectrum led at first to a six-colour description, but the mystical side of his nature wanted the answer seven - so he added indigo between blue and violet (which had the added virtue of making the ROYGBIV acronym more pronounceable).
A rainbow results from light rays of different colours being refracted different amounts when they pass through a droplet of water. Imagine yourself standing with your back to the sun and a raindrop in the sky in front of you. A ray of sunlight hits the raindrop, is bent as it enters it, and is then reflected off the inside far wall of the rain drop before being bent again as it exits the rain drop, before reaching your eye. For red light, the angle between the light striking the raindrop and the light emerging is 42, while for violet light it is about 40.6. So some raindrops, according to their position, will reflect red light back into your eyes, while others, in different places in the sky, will send other colours of the spectrum to you. And if you draw a line from the sun to your eye, and a line from your eye to the top of the rainbow, the angle between those lines will be 42.
A double rainbow occurs when light has been reflected twice inside the raindrops, like a snooker ball bouncing off two cushions before heading for the pocket of your eye. (The angle for a double rainbow is about 51).
Rainbows look brighter than the sky around them, because they are formed from light emerging from a whole body of raindrops whose three-dimensional mass exaggerates the brightness of a two-dimensional rainbow. If you see a double rainbow, you will notice that the area between the bow is darker than the surrounding sky - the rainbows have stolen much of the light that would naturally fall there. That area is called Alexander's Dark Band, after Alexander of Aphrodisias, who was the first to discuss it, in the second century AD.
The true poetry, however, is that any rainbow depends on the position of the observer. If you see one, it is your personal rainbow, not anyone else's.