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)