title: Collision algorithm for 2 moving object
body: <p>this is a Math problem for a 2d game.</p>
  
  <pre><code>Given 2 object ( 2 car, 2 tank, 2...), for each object i know: 
  1. X, Y 
  2. Actual Speed
  3. Degree of movement (or radiant)
  </code></pre>
  
  <p>How to calculate the "effect" of a collision for the 2 object</p>
  
  <p>Ps:</p>
  
  <p>I "move" the object with this simple formula each tick of my "game loop": </p>
  
  <pre><code>ychange = Math.Sin(radiant) * ((carspeed / xVar));
  xchange = Math.Cos(radiant) * ((carspeed / xVar));
  </code></pre>
  
  <p>(where xVar is a "multiplicator" to make more slow my car on the screen)</p>
  
  <p>And for the "first" object which collide, if i add a "minus" (-) in front of that formula, i can simulate a good "bounce" of the first object.. but not for the second.</p>
  
  <p>So my question regard a way to calculate a good (not perfect ! ) and more realistic "impact effect" for the second object.</p>
  
  <p>Thanks for your help </p>