title: Collision detection
body: <p>I am doing a project where there is a room filled with objects with different shapes.</p>
  
  <p>I am drawing the room in paint, being the picture all white and painting all the walls/obstacles red.</p>
  
  <p>I am drawing each movable object in a different file, also using paint.</p>
  
  <p>Now, I load both the map of the room and the objects as matrix of 1's and 0's to my program. I have one matrix for the first, and another matrix for each of the objects I load on the room.</p>
  
  <p>The object will be able to move freely in the room, moving by any distance, any angle, and being allowed to rotate itself. How should I go about devising a method that allows me to rotate the object by any angle and still being able to detect collisions? What I mean is that if the object could just go up, down, left and right, I could just check both the matrix to see if they "overlap" any of the 1's. But if I want to rotate the object, let's say, by 10º, I can't see how I can convert that to a matrix and check it against the wall's matrix.</p>
  
  <p>Should I drop the matrix representation and create mathematical regions and deal with this as we deal with it in IR^2 calculus, with some library? Wouldn't it be pretty expensive in computation terms?</p>
  
  <p>What is a simple method to do this? It doesn't need to be a top notch method, but I am using it for a complex algorithm and I wouldn't want to be losing too much computing time at each iteration with this.</p>