Yes, on a percussion hammer, measure from the centre of the square hole to the centre of the hammer cup. On the shotgun, measure from the centre of the tumbler hole in the square stud sticking out of the lock plate, to the centre of the nipple.
On a flintlock, the cock throw is the centre of the tumbler axle hole to the tip of the bottom jaw.
You may want to buy a pair of matching hammers as replacement hammers, as replacing only one of them will always look a little weird.