좌표평면상에서 회전변환행렬을 응용한 폰트 그래픽의 회전(90º및 180º)
선형 변환에서 회전변환행렬(Rotation matrix)은 임의의 행렬을 원점을 중심으로 회전시킨다.
![{\displaystyle {\begin{pmatrix}\cos \theta &-\sin \theta \\\sin \theta &\cos \theta \end{pmatrix}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/ab40477843fea7939707c800ffd3b668ee8ce685)
회전변환행렬(Rotation matrix)은 선형 변환의 성질중 하나이며, 동시에 여러 회전변환행렬중 일부는 대칭변환행렬 즉 반사행렬(Reflection matrix)과 관련이 있다.
|
원과 그 원의 중심점에 한점을 두는 두 선분을 예약하고,[1][2]
![{\displaystyle P=(x,y)\;\;,\;\;P'=(x',y')}](https://wikimedia.org/api/rest_v1/media/math/render/svg/d6ec0563de2bba99faded2ac409b8b1feb675058)
두 점 사이의 거리,
![{\displaystyle {\overline {OP}}={\sqrt {x^{2}+y^{2}}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/3abe97b041569427b7ffe60a4475635a45cbaf1f)
![{\displaystyle cos\alpha ={{x} \over {\overline {OP}}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/65c70c9948355d8f69a60db13b53f40999a11118)
![{\displaystyle {{x} \over {\sqrt {x^{2}+y^{2}}}}={cos\alpha }}](https://wikimedia.org/api/rest_v1/media/math/render/svg/b6c7ba88c13ec5326752a82546e6fe05bba5ef3e)
그리고,
![{\displaystyle sin\alpha ={{y} \over {\overline {OP}}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/5d606336abf06074cb0845878c5b53498116d676)
![{\displaystyle {{y} \over {\sqrt {x^{2}+y^{2}}}}={sin\alpha }}](https://wikimedia.org/api/rest_v1/media/math/render/svg/08ac31ff4a2b291d688afd0816fab24fd0792cd6)
그리고,
는 를 만큼 회전시킨 것이다.
![{\displaystyle x'={{\sqrt {x^{2}+y^{2}}}cos(\alpha +\theta )}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/1a851ee3a4c5787edfbce2d0315c6f614086a49d)
![{\displaystyle y'={{\sqrt {x^{2}+y^{2}}}sin(\alpha +\theta )}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/ebbd95f0ccdc7643c6535ed3d6b676a1d0b4d018)
삼각함수의 덧셈정리에서,
는,
![{\displaystyle x'={{\sqrt {x^{2}+y^{2}}}(\cos \alpha \cos \theta -\sin \alpha \sin \theta )}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/ee67643a97d3b6d77b2d04a986e2ce1e24a92707)
![{\displaystyle x'=\left({\sqrt {x^{2}+y^{2}}}{{x} \over {\sqrt {x^{2}+y^{2}}}}\cos \theta \right)-\left({\sqrt {x^{2}+y^{2}}}{{y} \over {\sqrt {x^{2}+y^{2}}}}\sin \theta \right)}](https://wikimedia.org/api/rest_v1/media/math/render/svg/b0b48cc47ef0ef018b9f657df8bdf382ac57e2e9)
![{\displaystyle x'={x}\cos \theta -{y}\sin \theta }](https://wikimedia.org/api/rest_v1/media/math/render/svg/3e3dbf5afe45d351375e035c6388a2dc0f4f6767)
는,
![{\displaystyle y'={{\sqrt {x^{2}+y^{2}}}(\sin \alpha \cos \theta +\cos \alpha \sin \theta )}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/ea1962482d499c688f3f13ba8e58aeb2416071b7)
![{\displaystyle y'=\left({\sqrt {x^{2}+y^{2}}}{{y} \over {\sqrt {x^{2}+y^{2}}}}\cos \theta \right)+\left({\sqrt {x^{2}+y^{2}}}{{x} \over {\sqrt {x^{2}+y^{2}}}}\sin \theta \right)}](https://wikimedia.org/api/rest_v1/media/math/render/svg/9b1f02715045d53bd293ed361fc1e2ae6556e913)
![{\displaystyle y'={y}\cos \theta +{x}\sin \theta }](https://wikimedia.org/api/rest_v1/media/math/render/svg/f602efb74036eaea81b93187758ce7e8d68f11a0)
x,y 순서로 정리하면,
![{\displaystyle y'={x}\sin \theta +{y}\cos \theta }](https://wikimedia.org/api/rest_v1/media/math/render/svg/8268768153f01281cbc5c3d655bf5a25958ce596)
연립방정식 형태로 나타내면,
![{\displaystyle {x}\cos \theta -{y}\sin \theta =x'}](https://wikimedia.org/api/rest_v1/media/math/render/svg/34e3eda67a04bbc41b0eeb54796d271bfb31d97d)
![{\displaystyle {x}\sin \theta +{y}\cos \theta =y'}](https://wikimedia.org/api/rest_v1/media/math/render/svg/b2ad9eb76649803031515abc9df714226b187032)
따라서,
![{\displaystyle {\begin{pmatrix}\cos \theta &-\sin \theta \\\sin \theta &\cos \theta \end{pmatrix}}{\begin{pmatrix}x\\y\end{pmatrix}}={\begin{pmatrix}x'\\y'\end{pmatrix}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/202ca9275008559082d7adbc02fce787ce224cbf)
|
비트맵 글꼴과 외곽선 글꼴에서 회전변환행렬은 유용한 정보처리를 표현한다.
점(3,5)를 원점을 중심으로 90º회전시켰을때, 삼각함수로부터 그 값을 예상해보면,
![{\displaystyle {\begin{pmatrix}\cos 90^{\circ }&-\sin 90^{\circ }\\\sin 90^{\circ }&\cos 90^{\circ }\end{pmatrix}}{\begin{pmatrix}3\\5\end{pmatrix}}={\begin{pmatrix}x'\\y'\end{pmatrix}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/185981adaf8516ff4055f9cf5541df5dbe08b909)
![{\displaystyle {\begin{pmatrix}0&-1\\1&0\end{pmatrix}}{\begin{pmatrix}3\\5\end{pmatrix}}={\begin{pmatrix}(0\cdot 3)+(-1\cdot 5)\\(1\cdot 3)+(0\cdot 5)\end{pmatrix}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/550eedf0a3c64e9a83012f3e72964626424df014)
따라서,