C/C++の宿題を片付けます 107代目
■ このスレッドは過去ログ倉庫に格納されています
0571デフォルトの名無しさん
2008/05/24(土) 01:57:44これでどう?
round は四捨五入する関数 ( 関数プロトタイプmath.h double round(double); )
void rotatePoint(POINT *p1,int dt){
double rad = dt * M_PI / 180.0;
int x,y;
x = p1->x;
y = p1->y;
p1->x = round(x * cos(rad) - y * sin(rad));
p1->y = round(y * cos(rad) + x * sin(rad));
printf("(%d,%d)\n",p1->x,p1->y);
return;
}
■ このスレッドは過去ログ倉庫に格納されています