Given a rectangular grid of points, draw a directed line segment from a point to an orthogonal or diagonal neighbor (one chess king move away). How many possible line segments are there?
f(x,y)=2*(4*x*y - 3(x+y) + 2)
This provides a large number of simple input gestures for a touchscreen keyboard. Every gesture is local, so it is easy to have explanatory annotations.
Other grids possible: consider 12 directions on a hexagonal grid.