Calculating the time it takes an object to rotate towards a moving target.
Hi all. I'm working on a 2D space game, but have hit a block with a maths problem which is a bit beyond me. I think this is solvable with a bit of trigonometry, but there might be a vector based solution too. I've searched for existing questions like this but haven't found anything i can apply. Thanks to anyone who takes the time to look at this for me - I'm hoping it will either be a fun challenge for people or so trivial that they won't mind helping! Also, sorry if my notation is really bad. I've tried my best but I'm a music grad!
The problem:
A space ship is travelling on a 2D plane with a fixed velocity on the y axis. The ship is rotating towards a fixed target point, at a known angular velocity (ω). I need to calculate the time (t) at which the ship is facing towards the target.
My attempt so far:
I have attempted to solve this with a bit of trigonometry, but I'm stumped on solving the final equations. I'm using two functions:
Δa = the change in angle a between the ship and the target due to the ships rotation
Δb = the change in angle b between the ship and the target due to the ships velocity
The desired time t occurs when these two angles are equal: a – b = 0
I've calculated these functions as shown below. Putting it all together, I need to solve the final equation for t. All other variables are known, but i don't have the maths skills to do this - hopefully it's not impossible :/
Thank you so much if you've even read this far.