角度转弧度&根据弧度计算圆周上点的坐标的方法
作者:互联网
原文链接:http://www.cnblogs.com/weilaikeji/p/3253893.html
角度转弧度:
#define AngleToRadian(angle) (M_PI/180.0f)*angle
以正东面为0度起点计算指定角度所对应的圆周上的点的坐标:
float radian = AngleToRadian(angle);
float x = center.x + cos(radian)*currentAdius;
float y = center.y + sin(radian)*currentAdius;
CGPoint point = CGPointMake(x, y);
以正北面为0度起点计算指定角度所对应的圆周上的点的坐标:
float radian = AngleToRadian(angle);
float x = center.x + sinf(radian)*currentAdius;
float y = center.y - cosf(radian)*currentAdius;
CGPoint point = CGPointMake(x, y);
转载于:https://www.cnblogs.com/weilaikeji/p/3253893.html
标签:angle,上点,AngleToRadian,float,currentAdius,弧度,radian,圆周,center 来源: https://blog.csdn.net/weixin_30882895/article/details/98115646