There are plenty of variables used to calculate HP.
Some of those are frontal area, accelleration, because its not constant, coefficient of friction between the tires and pavement, air friction, humidity, dry & wet bulb temperature, altitude, atmoshere pressure, heat losses from the engine, mass, weight, convertor slippage, cam specs, co;umetric efficiency of the engine, and all the other items mentioned earlier by others here. As you can see, it is an involved calculation.
However, there is an out. I use the formula to calculate HP using the car's speed through the traps at the top end of a 1/4 mile track, i.e., speed lights.
The formula is as follows: HP = weight times the quantity cubed 0.00426 times MPH, HP=weight X (.00426XMPH)^3. This formula is supposedly accurate to +/-5%.
You need to know MPH as HP makes MPH, Torque makes ET.
Just my two cents worth....I'm sure others will have comments, I could be wrong, ask my wife.....