title: How to draw a Perspective-Correct Grid in 2D
body: <p>I have an application that defines a real world rectangle on top of an image/photograph, of course in 2D it may not be a rectangle because you are looking at it from an angle.</p>
  
  <p>The problem is, say that the rectangle needs to have grid lines drawn on it, for example if it is 3x5 so I need to draw 2 lines from side 1 to side 3, and 4 lines from side 2 to side 4.</p>
  
  <p>As of right now I am breaking up each line into equidistant parts, to get the start and end point of all the grid lines.  However the more of an angle the rectangle is on, the more "incorrect" these lines become, as horizontal lines further from you should be closer together.</p>
  
  <p>Does anyone know the name of the algorithm that I should be searching for?</p>
  
  <p><strong>Yes I know you can do this in 3D, however I am limited to 2D for this particular application.</strong></p>