/* 2D旋轉
Programmed by Meng-Luen Wu */
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#define PI 3.14159265
int main(){
//順時針旋轉 k 度
double x=20,y=30;
double rx,ry;
int k=90;
rx=x*cos(k*PI/180)+y*sin(k*PI/180);
ry=x*-sin(k*PI/180)+y*cos(k*PI/180);
printf("(%.2f,%.2f)",rx,ry);
system("pause");
return 0;
}
文章標籤
全站熱搜

good job!! inverse rotation matrix!!
看完這篇文突然想到,有興趣的話可參照 picasa 在 user 做 rotation 時,它處理還蠻特別的,以中心做 rotation, 會放大縮小, 應不難做, 但應蠻有趣的 :)
加油!感覺說太多會太嗆@@
我不用懷疑 這的確是個無腦的程式...