Aiming a turret (Math question)

Yukova, I’m not OP, but I am trying to achieve a similiar behavior in your youtube video. Can you offer some insights?