Aiming a turret (Math question)

, give me some time to clean up the example, and then I’ll post a full explanation (with source).