Sure there is a formula. It's π r2 x stroke x number of cylinders. In this formula, 'π' is Pi (3.14159); 'r' is radius, which is one-half of the bore; 'stroke' is, of course, the piston stroke; and the number of cylinders is self-explanatory.
So, if a two-cylinder engine has, say a 67mm and a 66.8mm stroke, like the new Honda CBR500R, you take one-half of the bore (33.5mm), 'square it' by multiplying it by itself (33.5 x 33.5 = 1122.25), then multiply that times π (Pi) (3.14159 x 1122.25 = 3525.6493775). Next, multiply that figure times the stroke (66.8 x 3525.6493775 = 235513.378417), then multiply by 2, which is the number of cylinders (2 x 235513.378417 = 471026.756834).
Finally, since out math converted millimeters into cubic centimeters, we have to multiply the result by .001. So, 471026.756834 x.001 = 471.026756834, which, rounded off is 471cc.
Is there a formula to determine an engine's displacement using its bore and stroke sizes?