One look at a fly will tell you that the eye of a fly is not much like ours. First of all, fly eyes take up a lot of real estate on the fly head. All the better to see you with, my dear. The fly can see a full 360 degrees front to back and about 270 degrees north to south.
Unlike our eye, the fly eye is a compound eye in that it is made up of many, many tiny lenses. The electron microscope has shown that each of these lenses is connected to its own set of neurosensory cells. Experiments have shown that these cells are part of a very fast sensory processing system. Fly visual acuity is not that great (think big pixels), but motion detection is fantastic.
The fly is very good at detecting the movement of lines (the edge of a fly swatter) across its visual field. The fly brain calculates the speed and direction of a line (or lines) across the visual field and then it chooses a an appropriate direction in which to obtain escape velocity.
If you move a fly swatter or your hand directionally across the visual field of a fly, you don’t stand much of a chance. Even if you are very fast, the reflexes of the fly are faster. Some have suggested that they best way to swat is to try and predict which way the fly will exit and then aim your swat in that direction to intercept the fly. This is sort of like creating your own missile defense system. The problem is that you have to be accurate in your prediction, which is difficult because the fly is small, there are 360 directions in which the fly can go, and your swatter only covers about 45 of them.
Fortunately, we can use the physiology of the fly visual system against it. The fly is unable to identify a particular threat. It does not know a fly swatter from a door. All it detects is motion. If you move the swatter (or your hand) slowly toward the fly in a perpendicular fashion, you will minimize apparent motion across the fly visual field. When you get close to the fly, the motion can be accelerated to swat speed, keeping the same perpendicular track. What the fly will see in the visual field is a set of lines moving outward in all directions at the same rate of speed as the object grows larger in the visual field, but there is very little movement across the visual field. This creates confusion in the fly as to which way to escape. A moment of indecision is created and you have your chance.
Try it the next time a fly lands on your leg. The technique works better with your hand (yuck) than it does with a fly swatter or a newspaper, because you have more control with your bare hand (or you can use a glove!).