iOS-计算绕某点旋转得到旋转后的点公式

#define pointRotatedAroundAnchorPoint(point,anchorPoint,angle) CGPointMake((point.x-anchorPoint.x)*cos(angle) - (point.y-anchorPoint.y)*sin(angle) + anchorPoint.x, (point.x-anchorPoint.x)*sin(angle) + (point.y-anchorPoint.y)*cos(angle)+anchorPoint.y)


复制到项目中就可以直接使用

point为旋转前的点

anchorPoint 围绕该点旋转

angle  旋转角

猜你喜欢

转载自blog.csdn.net/like_sky_/article/details/72822176