角度转弧度&根据弧度计算圆周上点的坐标的方法

 

角度转弧度:  

#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);

你可能感兴趣的:(方法)