An approximation that I use considers the sprocket sizes and the frame measurements; (assumes normal tire clearance).
Half the number of teeth of both sprockets, (e.g., half 26 + 11 = 18.5") plus 2-times the distance between the center of the bottom bracket, and the axle sweet-spot on the rear drop outs or forward-release fork-ends, (e.g., 18.75" x 2 = 37.5"). If a fraction results for the overall result, then round-up to nearest 1".
The half-X factor is because the chain only contacts about half of the teeth at one time; the 2-X factor is to account for the upper and lower segments of chain, between the 2 sprockets. The round-up is due to steel chains not stretching during installation, and the rear drop outs (or forward-release fork-ends) allowing for adjustment for a longer chain, (i.e., axle sweet-spot).
It is an approximation-only, mostly because of the angles of the chain line, and less-so their tangents to the sprockets.
For a perfect un-worn chain, the length (e.g., 18.5" + 37.5" = 56"), in inches, would equal the number of link pairs (e.g., 56 big and small).
Worn chains may measure in-inches more than the number of link pairs.
For half-inch pitch chains the general method is similar, with some math differences due to the number of teeth per inch, and allowance for half-links.