For a little background, this problem came up due to something I'm trying to code, however the problem itself is disparate from that. I know the basics of projectile motion and kinematics from a pair of Physics classes I took for CCP, but to figure this out would be far too tedious at current.
Is it possible to figure out the angle of a projectile's lauch knowing only x naught, y naught, x one, y one, "gravity," and the magnitude of the initial velocity? No time, no components of the velocity, and no final velocity.
Intuitively I can tell you that there should be exactly two answers for any given starting conditions (with the exception of anything where (x1, y1) lies at the vertex of any trajectory above 45°, if my sleepy brain processes that right), and I want both of those. The thing is that I don't know of any equations that can pull that angle out (even just vx0 or vy0 would be enough) without time, which is something I explicitly want to be able to pull from this equation for the next iteration.
For reference, the reason I need to do it this way if because I'm internationally refining a predicted trajectory based on another moving object (therefore time is needed to figure how far said other object will move in that time), as shown here, in the non-gravity-compensating version: https://paste.mod.gg/ejoxasabod.cpp Since the code is recursive, I need an equation that plays nicely with that, and doesn't need time up front. Unless - and I know this is veering off math and into code - there is a way to use straight-line-time to estimate the time needed. That is, is it possible to turn this into a problem of ratios? If I know the magnitude of the initial velocity and the positions of both objects, is it feasible to figure out time just by inferring how long it would have to take based on how far off of horizontal the final location is?
I know for a fact that this is possible, but I'm not sure how to do it at the moment. I'm certain a system of equations could do it, but I'm not sure if I could code that in in C#. If anyone has any ideas on either the math or coding aspects, throw them my way; they are greatly appreciated!