What didn't work like you wanted is line 3 (like you thought). It is because after converting to radians, there are only four possible 'int' values that 'angle' can be set to (zero, and the three between zero and PI). You will need to change 'angle' to a 'double' to make it work.