Our brains track moving objects by applying one of the algorithms our phone’s GPS uses, according to researchers. This same algorithm also explains why we are fooled by several motion-related optical illusions, including the sudden ‘break’ of baseball’s well known ‘curveball illusion.

The researchers shows that our brains apply an algorithm, known as a Kalman filter, when tracking an object’s position. This algorithm helps the brain process less than perfect visual signals, such as when objects move to the periphery of our visual field where acuity is low.

However, the same algorithm that helps our brain track motion can be tricked by the pattern motion of an object, such as the seams on a spinning baseball, which causes our brain to “see” the ball suddenly drop from its path when, in reality, it curves steadily.

Though we often rely on Global Positioning System (GPS) to get us to our destination, the accuracy of GPS is limited. When the signal is “noisy” or unreliable, our phone’s GPS uses algorithms, including the Kalman filter, to estimate the location of our car based on its past position and speed.

Like GPS, our visual ability, although quite impressive, has many limitations. We see an object’s position with great accuracy when it’s in the center of our visual field. We do poorly, however, at perceiving position when it shifts into our visual periphery; then our estimate of its position becomes unreliable. When that happens, our brain gives greater emphasis to our perception of the object’s motion.

And, this is where we start seeing fascinating phenomena like the curveball illusion. Researchers have found that the same algorithm that is used by GPS to track vehicles also explains why we perceive the curveball illusion.

A curveball pitch does actually indeed curve. But when it is viewed in the visual periphery, the spin of the ball–the motion of the seam pattern–can make it appear to be in a different location than it really is.

Here, the brain ‘knows’ that position estimates are unreliable in the periphery, so it relies more on other visual cues, which, in this case, is the motion; the spin of the ball.

The perceived motion and position of the curveball depends on where it is in our visual field. So, when the ball enters our periphery, it appears to make an abrupt shift: The infamous and sudden “break” of the curveball as it nears home plate.

The Kalman filter algorithm, named after its coinventor, mathematician Rudolph Kalman, is used to find optimal and integrated solutions from noisy or unreliable data whether in GPS or our brains.

Most of the time our vision does a really good job, but in some cases, such as a breaking curveball, the optimal solution that our brain comes up with belies the actual behaviour–and trajectory–of the ball, and the result is an optical illusion.

Therefore, we have a better chance of hitting a curveball by realizing that our brains, like GPS, can lead us to “see” changes in speed or direction that don’t actually occur when the ball moves from the center of our visual field to the periphery.