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

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


以正北面为0度起点计算指定角度所对应的圆周上的点的坐标:

    float radian = AngleToRadian(angle); 

    float x = center.x - sin(radian)*currentAdius;

    float y = center. y + cos(radian)*currentAdius;

你可能感兴趣的:(3D)