如图,我有个列表List<Item> 就是上面9个方块 ,需要参与的Item旋转 90度、 180度、270度
转换前(0度)
(1)000x000 (2)100x000 (3)200x000
(4)000x100 (5)100x100 (6)200x100
(7)000x200 (8)100x200 (9)200x200
转换90度后
(7)000x000 (4)100x000 (1)200x000
(8)000x100 (5)100x100 (2)200x100
(9)000x200 (6)100x200 (3)200x200
public class Item
{
int x,
int y,
int width=100,
int height = 100,
int angle = 0,
}
求大神给一个算法, 支持顺时针 、逆时针旋转,有可能不是9个 例如:(0124)(1258)