游戏中的数学逻辑(基本触发),这段代码在做什么?

ran*_*its 2 iphone algorithm math cocoa-touch trigonometry

我正在努力更好地理解这段代码到底在做什么.它是用Objective-C编写的,但对于具有C背景的人来说应该很熟悉.Sin/cos数学到底在做什么?此外,是否有人有一个很好的建议学习触摸游戏概念,如这些?

for (int i = 0; i < GAME_CIRCLES; i++)
{
    point.x = center.x - sin (degree) * RADIUS;
    point.y = center.y + cos (degree) * RADIUS;
    mPieRect[i] = CGRectMakeWithCenter (point, RADIUS - 4);
    degree += PI / 3.0;
}
Run Code Online (Sandbox Code Playgroud)

Pau*_*xon 7

这是一个圆的参数方程(参见维基百科)

我猜测"度"变量实际上是弧度而不是度数.圆圈有360度,或2*Pi弧度.

通过将度数变量提前Pi/3,它踩到1/6左右