벡터 (x,y)를 90도 회전하는 방법

1. 회전 행렬

 

벡터 (x,y)는 극좌표계를 이용하면 $(rcos \theta , rsin \theta)$

 

 

 

이 상황에서 A만큼 회전시킨다면... Q의 좌표는 $(rcos (\theta + A), rsin (\theta + A))$

 

 

 

삼각함수의 덧셈정리를 이용하면 $cos (\theta + A) = cos \theta * cosA - sinA * sin \theta $이고 

 

$sin (\theta + A) = sin \theta * cos A + cos \theta * sin A$

 

$x = rcos \theta, y = rsin \theta$이므로 이를 대입하면...

 

$x' = rcos (\theta + A) = x cos A - y sin A, y' = rsin (\theta + A) = ycosA + xsinA$

 

따라서 Q(x',y')과 P(x,y)는 다음과 같은 관계가 성립한다

 

$$\begin{pmatrix} x' \\ y' \end{pmatrix} = \begin{pmatrix} cosA & -sinA \\ sinA & cos A \end{pmatrix} \begin{pmatrix} x \\ y \end{pmatrix}$$

 

 

2. 90도 회전

 

반시계방향으로 A = 90'라면, cos90' = 0, sin90' = 1이므로 x' = -y, y' = x가 되니까 (x',y') = (-y,x)

 

시계방향으로 A = -90'라면 cos-90' = 0, sin-90' = -1이므로 x' = y, y' = -x가 되니까 (x',y' = (y,-x)

 

 

 

 

 

TAGS.

Comments