The problem is that I have an image with lines drawn on it. I am using a mapping tool much like google maps which tiles images of the current map on the screen. Each square is drawn individually so there may be times that a line intersects the current square. There may also be occasions where the line could be contained in a square. Lines can be in any direction.