Say I have a traingle with vertices (0,0), (240,0), and (240,180). With I want to rotate this triangle about (0,0) so that the coordinates of the vertices remain integers. I want to count the number of such triangles which upon rotation have integer coordinates. What would be the algorithm for this?