I have a ship that travels at max speed maxSpeed
and can turn rotationSpeed
degrees per second. The ship always moves in the direction it is facing which means that the faster the ship is travelling the larger its turning radius is.
I know my position, and rotation and the target's position.
What I would like to figure out is whether a target is inside my turning radius at this speed, or better, what is the maximum speed I can travel at is in order to make the turn to the target without continually circling around it.
Is there an efficient(ish) way to do this?
Here is what I am thinking so far: because I know how far I am travelling per step and how much I am rotating per step, I can figure out where I will be in the next two frames. My current position is p1, my next position is p2 then p3. I can take the perpendicular bisectors of (p1, p2) and (p2, p3). Their intersection point will give me the center of a circle. I can then test if the target is in that circle.
I'm unsure if this will work in 3D (I'm unsure how to calculate a sphere with my inputs). This solution also doesn't help too much with finding the right speed at which to travel, I would have to try a few times with different speeds to find a reasonable one.
Can anyone shed some light on a better solution?