I am trying to simulate a rocket launch.
Let's say all the forces on the rocket are applied at its center of mass.
Let's say the center of mass of the rocket is currently at point named P1.
Let's say the goal point the rocket will have to reach is named P2.
I can simulate some forces applied to the rocket (such as weight, thrust and drag).
I can then compute the acceleration and then the speed and finally update the position.
I use 2 angles, one for the direction of the path the rocket is actually following and the other one need to be the angle of attack.
Given the forces, how can I compute the angle of attack which the rocket shall have so as to follow a straight line from P1 to P2?
The red line is the path the rocket shall follow from P1 to P2.
The green vector is the thrust.
The blue line is the line that the rocket shall point so as to have an angle of attach named 'a' (orange color) which will let the rocket follow the red line.
For example I can extract the following equation:
$$ \frac{P2_x - P1_x}{P2_y - P1_y} = \frac{engine_x - drag_x}{engine_y - weight - drag_y} $$
The left fraction contains the coordinates of the 2 points.
The right fraction contains all the forces that act upon the rocket.
For example $engine_x$ is the component of the engine's power in the horizontal axis. And so on.
I need one more equation in order to solve them together and find $engine_x$ and $engine_y$.
If this equation is wrong then correct me. I just need those equations.
For example maybe the second equation can be like:
$$ engine ^ 2 = engine_x ^ 2 + engine_y ^ 2 $$
Because I know the power of the engine, then I can compute $engine_x$ and $engine_y$ and the angle of attack might then be their arctangent.
NOTE: Let's say I also know $drag_x$, $drag_y$, the $weight$ and of course the points' location.