A relatively moving surface is illuminated with a laser. Light from the
laser is reflected by the surface into an array of photosensitive
elements; the reflected light includes a speckle pattern. Sums are
calculated for outputs of pixels perpendicular to a first dimension along
which motion is to be determined. Motion along the first dimension is
then determined based on spatial and temporal gradients of the calculated
sums. Sums are also calculated for outputs of pixels perpendicular to a
second dimension along which motion is to be determined. Motion along the
second dimension is then determined based on spatial and temporal
gradients of those sums. The array may be rectangular, or may contain
arms separated by a pixel-free region.