Measuring a rotary axis