기하학에서 2D 기하 변환 (2D Geometric Transformation)에 대한 기본 내용 정리
Transformations
Geometric Transformation이란 기하학적인 구조를 가진 집합을 one-to-one mapping을 통해 옮기는 것으로, 쉽게말해서 점들의 집합을 이동시키는 것
기본이 되는 2D 변환으로는 평행이동(translate), 회전(rotate), 확대/축소(scale), 전단(shear), 대칭(reflect) 등이 있으며, 기본 2D 변환을 조합한 다양한 카테고리의 2D 변환 방법들이 있음
Linear Transformation
행렬곱(matrix multiplication)을 통해 transformation 하는 방법 다음 수식들을 만족함
2D Linear Transformation
- 2x2 행렬이 2D linear transformation을 나타내며, 다음과 같은 transformation이 가능
- scale, rotation, shear, reflection 등
- Translation의 경우 linear transformation이 아님(행렬 곱만으로 표현 불가)
Scale
- x축이나 y축 방향으로 늘리거나 줄이는 것
- x축과 y축을 같은 배율만큼 scale 하는 것을 uniform scale이라 하고, 다른 정도로 scale 하는 것을 non-uniform scale이라 함
- 이 때, 을 만족하면 uniform scale
Rotate
- 좌표계 원점을 기준으로 회전을 표현함
Reflection
-
어떤 축을 기준으로 대칭(반사)=Flip 시킨 것으로 non-uniform scale의 한 케이스
-
세로(y) 축 대칭:
-
가로(x) 축 대칭:
Shear
- 대각선으로 비틀린 모양
- 좌우 비틀기:
- 위아래 비틀기:
Affine Transformation
Semi Linear Transformation 으로 linear transformation + translation 을 의미함 Linear Transformation에 해당하는 2x2 행렬과 평행이동의 2x1 벡터로 구성돼 6DOF를 가짐
Linear transformation의 일부 특징을 포함해서 다음과 같은 특징을 가짐
- preserve lines (선 보존)
- preserve parallel lines (평행선 보존)
- preserve ratios of distance along a line (선 거리 비율 보존)
2D Translation (평행 이동)
-
2차원에서 translation은 다음과 같이 적용
-
이는 행렬 곱으로 나타낼 수 없으므로 linear transformation이 아님
Rigid Transformation
Rotaion + Translation 으로, 회전과 평행이동을 동시에 수행하는 것
다음과 같은 특징을 가짐
-
preserve distances between all points
-
preserve cross product for all vector ⇒ preserve angles
→ to avoid reflection -
모든 vector끼리의 cross product(외적)이 유지되며, 이 덕분에 reflection을 피할 수 있게 됨
-
만약 reflection을 통해 이동시키게되면 방향이 뒤집어져 되어버리기 때문에 cross product의 방향 또한 반대가 됨
-
현재의 cross product가 화면 바깥쪽을 향하고 있다면 reflect하게 되면 cross product가 화면 안쪽을 향하게 되어버림