title: How to project a polygon on an axis
body: <p>I'm trying to learn the <strong>Separating Axis Theorem</strong>. This is because I'm making a simple 2D game and I need this as a way to detect if two polygons are intersecting.</p>
  
  <p>Problem is, I suck at math.</p>
  
  <p>So far, I understand that in order to know if two polygon are intersecting, I need to do the following:</p>
  
  <ol>
  <li>Creata a perpendicular line to every edge of the two polygons.</li>
  <li>Project each polygon to each of the new lines created (the axes).</li>
  </ol>
  
  <p>If <strong>all</strong> projections of the first polygon overlap <strong>all</strong> projections of the second polygon, the shapes intersect. Else, the shapes do not intersect.</p>
  
  <p>I think I understand how to do step 1. But I don't understand how to perform step two.</p>
  
  <p>How can I project a polygon onto an axis? Please explain this in a language I will be able to understand, as a person with pretty basic knowledge at math.</p>
  
  <p>(Although I <em>did</em> learn some math concepts such as dot product and vectors, at a basic level. So you <em>can</em> talk to me using these terms.)</p>
  
  <p>Theoretical explanation will be great, but an example on how to implement this in code (preferably Java), will also be welcome.</p>
  
  <p>Help will be appreciated. Thanks a lot</p>