Measure distance between 2 circuits

It will be easy to guess the temperature to get within 1-2%. 34cm/10m is about 3%. 34/5m is 6%. Mostly I want to know if it's moving further away or closer to keep it at a constant distance.

What is the advantage of optical compared to 2-way sound? The disadvantage is that light is much harder to point in the right direction from a moving rotating object.