본문 바로가기
Borland

사각형 회전후 좌표 값 구하기

by leo21c 2012. 9. 10.
SMALL

사각형의 각 좌표를 seta 만큼 회전 한 후에 좌표 값을 구하는 방법

seta; 각도
pre_x, pre_y: 이전 좌표

float r = 0.01745328; // 3.141592 / 180
float radian = seta * r;
float s = sinf(radian);
float c = cosf(radian);
float x = pre_x * c - (pre_y * s);
float y = pre_x * s + (pre_y * c); 


LIST