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)

? f(3,3)

40

? f(3,4)

58

? f(3,5)

76

? f(3,6)

94

? f(4,4)

84

? f(4,5)

110

? f(4,6)

136

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.

## No comments :

Post a Comment