I rotate each piece by rotation formula. More detail, because rotation angle is 90 so :
xNew = y;
yNew = -x;
But my method has met two problems :
1) Out of box : each type of pieces is fit in square 4x4. (0,0 at under left) But by this rotation, at some case they will out of this box. For example, there is a point with coordinate (5,6) So, please help me how to fit these coordinate into 4x4 box again, or give me another formula for this.
2) at I case : (4 squares at same row or same column), just has two rotations case. but in method above, they still has 4 pieces. So, how to prevent this.
Thanks :)