This article is from the Photographic Lenses FAQ, by David Jacobson with numerous contributions by others.
If the format has a width, height, or diagonal of distance X, the angle of coverage along width, height, or diagonal is 2*arctan(X/(2*f*(M+1))). For example a 35mm frame is 24x36 mm, so with a 50 mm lens and a distant object (i.e. M virtually zero), the coverage is 27 degrees by 40 degrees, with a diagonal of 47 degrees. See the technical notes at the end for qualifications.