General Formula for Checking External and Internal Spur Gears by Measurement over Pins