Ahh - yeah I forgot to mention, it will need special cases for ballSpd == 0 or direction = 90, as these two simulations will be close to division by 0, which is a small no-no.
I'd suggest if the conditions of delta being non-90d, and speed of both greater than 0, then you solve with specific conditions.
I'm wondering if the code works with a delta angle of around 30degrees?
Don
have a great day