I have an array that contains the state of certain cells. It looks like this.
I am trying to rotate the array using this formula:Code:5 4 3 * * * * y 2 * * * * 1 * * * * 0 * * * * 0 1 2 3 4 5 x
x' = (x * Cos deg.) - (y * Sin deg.)
y' = (x * Sin deg.) + y * (Cos deg.)
The code (VB .Net) uses Math.Cos & Math.Sin which produce double results. I think my problem happens when I convert the results to integer. Am I missing something?




Reply With Quote