This should be simple but my math skills are really bad ...
I have an image of 36 images (6 by 6 matrix). These small images are 36 instances of a direction arrow (like from Google maps GPS), each image rotated by $10^\circ$ from $0^\circ$ to $350^\circ$.
I don't know how to get image $X$ and $Y$ position of each small image when I have the rotation amount. Images are $50\times50\,\mathrm{px}$, so...
- for $10^\circ$ image is at $50\times0\,\mathrm{px}$,
- for $20^\circ$ image is at $100\times0\,\mathrm{px}$
- for $90^\circ$ image is at $150\times50\,\mathrm{px}$ (because it is on row 2)
- ...
- for $350^\circ$ image is at $250\times250\,\mathrm{px}$
What is the formula to get this $X-Y$ value?

Should be something like X=(degrees mod 60)*5, Y=(degrees div 60)*50