Encoders and inclination sensors