I have a spaceship. Green vector is an origin (direction spaceship points to). Red vectors are direction where velocity will be applied.
I need to rotate spaceship with blue angle (nearest). In pseudocode I have:
angle = Vector2.Angle(velocity, origin) spaceship.rotation += angle
But in this case (with angle addition) it will rotate only counterclockwise. In first two cases (pictures) this is wrong, there should be angle distraction. The third case is ok, it will get the right velocity in nearest angle.
So, what is the condition when I should use distraction instead of addition angle?