Angle required to hit polar coordinate (x,y) - (projectile following a ballistic trajectory)

Description

In physics, the ballistic trajectory of a projectile is the path that a thrown or launched projectile or missile without propulsion will take under the action of gravity, neglecting all other forces, such as friction from aerodynamic drag.
The United States Department of Defense and NATO define a ballistic trajectory as a trajectory traced after the propulsive force is terminated and the body is acted upon only by gravity and aerodynamic drag. A special case of a ballistic trajectory for a rocket is a lofted trajectory, a trajectory with an apogee greater than the minimum-energy trajectory to the same range. In other words, the rocket travels higher and by doing so it uses more energy to get to the same landing point. This may be done for various reasons such as increasing distance to the horizon to give greater viewing/communication range or for changing the angle with which a missile will impact on landing. Lofted trajectories are sometimes used in both missile rocketry and in spaceflight.
The following applies for ranges which are small compared to the size of the Earth. For longer ranges see sub-orbital spaceflight.

To hit a target at at distance r and angle of elevation phi (polar coordinates) when fired from (0,0) and with initial speed v the required angle(s) of launch theta can be calculated by the formula shown here.

PLEASE NOTE : Solving for any variable other than theta might not give accurate results.

Related formulas

Variables

θangle at which the projectile is launched (rad)
vInitial Velocity ( the speed at which said object is launched from the point of origin) (m/s)
gStandard gravity
rdistance (m)
ϕangle of elevation (deg)