Theodolite is an instrument used for measuring