What you need is a theodolite, which is an instrument that measures angles very precisely. Suppose you could measure the angle to the top of the flagpole from where you are standing. It is simple ...