Horse power is a mechanical dimension ,not a measured unit, then it was adopted by the RAC in 1910 again as measurement .
The so-called RAC horsepower rating was devised in 1910 by the RAC at the invitation of the British government. The formula is:
RAC h.p. = 2 /5 D 2 n
where D is the diameter (or bore) of the cylinder in inches and n is the number of cylinders
Look it up on Google - its too long to copy onto here