Nemo,
The 'theory' _is_ simple. figure out where the center of mass is for whatever the table shape is, and position the _ground_ points of the legs as far away as practical.
legs that slant outward from the table will provide better stability than pure vertical ones.
The -best- three-legged placement you can do with a rectangular top is two legs at opposite ends of one of the *short* sides, and the third leg in the middle of the other short side. (comment, there is a _reason_ that 'ironing boards" -- for those who remember what _those_ are -- are built that way.)
Here's the way it works: Draw the triangle that represents the leg positions. No possible pressure _inside_ that triangle can cause the table to tip, short of structural failure.
Tipping occurs when sufficient pressure is applied -outside- that triangle. The shorter the moment arm that that pressure has to work on, where the fulcrum is the nearest edge of the triangle, the more force it actually takes to reach the tipping point.
For a rectangular top, there are two possible 'maximum size' triangles. Two legs on a narrow end, and one in the middle of the other narrow end and two legs on a wide side, with the third in the middle of the other side.
Both forms provide _exactly_ the same size 'stable area' (inside the triangle), ie., half the total table surface.
*BUT* the distance from an 'unsupported' corner to the closest point _on_ the leg triangle is smaller when the 3rd leg is in the middle of the short side. Which means that it is -harder- to tip by applying pressure there.Also, and *very* counter-intuitively, angling the two short-side legs out past the long side of the table does -more- to improve stability than does extending the single leg past the short end. Of course, doing -both- is better than doing just one (either one).