If you have the start and end coordinates of each line segment comprising the grid, I might be able to help you. Please inform. Also, is your goal just to detect these intersections, or is it to partition the grid by them?