Internal Momentum Physics Question in recreating an Asteroids Video Game Experience I'm recreating Asteroids (Atari) as a programming challenge for myself to better understand physics, and have come across a problem I'm having a challenge with.
In the attached image, my ship is pointed at 42 degrees.
So here's the question - If my ship is traveling at velocity "V1" in the  direction of angle "A1" (42 degrees as depicted). AND I then rotate the ship to angle "A2" as the inertial forces maintain the velocity at the original angle minus simulated frictional forces which decelerate the ship over time - AND I then apply a secondary force "N2" towards angle "A2", how can I determine...

*

*The new velocity of the ship

*The new angle of the ship.

In a reusable formulaic approach....
Thank you in advance, I had a bear of a time with University Physics and literally failed it three times before switching from a CSE major to CIS way back in 1993, but now I'm just curious about the video games I've loved over the years and how those programmers did what they did....
As previously stated, I'm trying to recreate the movement from the original Asteroids from 1979, which can be seen on Youtube....  here https://www.youtube.com/watch?v=WYSupJ5r2zo
I'm suspecting I might have to arbitrarily assign a mass to properly calculate force, but I will be the first to admit, I'm a tad lost...
Again, Thank you!

 A: The most common approach is to keep track of the position, velocity and force components (as in X,Y directions) as well as the orientation angle of the object. It is important to understand that you need to track the center of mass of each object.
The at each time step calculate the acceleration components and increment the velocities first and the position after.

*

*Thrust
A force $F$ applied at an angle $\theta_Z$  has components of along the XY plane as $$ \pmatrix{F_X \\ F_Y} = \pmatrix{F \cos \theta_Z \\ F \sin \theta_Z}$$ provided that the angle is measured from the horizontal in a counter-clockwise fashion. Also X is to the right, and Y is up.


*Accelerations
$$ \pmatrix{a_X \\ a_X} = \frac{1}{m} \pmatrix{F_X \\ F_Y} $$
$$ \alpha_Z = \frac{1}{I} \tau_Z $$
where




quantity
description




$(F_X,F_Y)$
components of force applied


$\tau_Z$
total torque about COM


$m$
mass of object


$I$
mass moment of inertia of object


$(a_X,a_Y)$
components of acceleration


$\alpha$
rotational acceleration





*Simulation Frame
A time step $h$ is simulated with the verlett integration method
$$ \begin{aligned}
  t & \rightarrow t + h \\
  v_X & \rightarrow v_X + h \, a_X \\
  v_Y & \rightarrow v_Y + h \, a_Y \\
  \omega_Z &  \rightarrow \omega_Z + h \, \alpha_Z \\
  r_X & \rightarrow r_X + h \, v_X \\
  r_Y & \rightarrow r_Y + h \, v_Y \\
  \theta_Z &  \rightarrow \theta_Z + h \, \omega_Z \\
\end{aligned} $$
where




quantity
description




$t$
current time


$(r_X,r_Y)$
components of position


$\theta_Z$
orientation angle of body


$(v_X,v_Y)$
components of velocity


$\omega_Z$
rotational speed of body



A: Sounds like an interesting project. I'll preface this by saying that I have next to no experience in making games so I don't know how helpful or accurate this will be. But, from your comment it sounds like you have already implemented something that translates key presses into movement of the ship. You could probably modify this slightly to accommodate the case where the ship was already moving.
Upon a keypress, say your current code calculates a velocity $v_1$ and angle $\phi_1$ for the ship's movement. If the ship was already moving at velocity $v_0$ and angle $\phi_0$ you would instead output:
\begin{align}
v &= \sqrt{(v_0\cos\phi_0+v_1\cos\phi_1)^2+(v_0\sin\phi_0 + v_1\sin\phi_1)^2} \\
\phi &= \arctan\left( \frac{v_0\sin\phi_0 + v_1\sin\phi_1}{v_0\cos\phi_0 + v_1\cos\phi_1} \right)
\end{align}
Alternatively (if you wanted to), you could probably work with Cartesian representations of the velocity vector, which would be simpler since you'd just do a vector sum of the velocities. E.g. if the initial velocity vector were $(v_{0x},v_{0y})$ (in the $x$ and $y$-directions of the screen) and the change in velocity was $(v_{1x},v_{1y})$, then the resultant velocity would simply be $(v_{0x}+v_{1x},v_{0y}+v_{1y})$.

I'm suspecting I might have to arbitrarily assign a mass to properly calculate force

There's probably no need to worry about the dynamics of the movement---all of it would be baked into your decision on how much the ship should accelerate when the corresponding key is pressed.
Hopefully this helps somewhat.
