The line has slope (b2-a2)/(b+a).
Starting at (-a,a2), the line rises a*(b2-a2)/(b+a) while going to the y-axis, where it therefore hits at
y = a2 + a*(b2-a2)/(b+a)
which simplifies to a*b.
Similar reasoning applies when the direction of travel along the line differs from that assumed above, as when a and b have opposite signs.
The sculpture at the Museum of Mathematics uses buttons to represent integers from 1 to 10 as the two multiplicands. In two dimensions it represents what is called a nomogram, where the alignment of two numbers shows on a third scale the result of some operation on those two numbers. The museum just rotated the plane of different problems to produce a sculpture that's more interesting by being 3-D, but hides the two-dimensional nature of the nomogram if you don't read the nearby computer's explanatory material, which most people don't.