4 - Affine Space / Frame / Matrix
Outline
- Affine Space - Point vs. Vector
- Coordinate System & Reference Frame
- Affine Transformation Matrix
- Interpretation of Composite Transformations
Affine Space - Point vs. Vector
- ๊ฐ๋ ์ ์ผ๋ก point์ vector๋ ๋งค์ฐ ๋ค๋ฆ
- ์ด ์ฐจ์ด๋ homogeneous coordinates๋ก ํํํ ์ ์์
- ์ด ๊ฐ์์์๋ affine space, point์ vector์ ์ฐจ์ด์ , ๊ทธ๋ฆฌ๊ณ ๊ทธ๊ฒ์ด homogeneous coordinates์ ์ด๋ป๊ฒ ์ฐ๊ฒฐ๋๋์ง๋ฅผ ํ์ตํจ
- ์ด ๊ฐ๋ ์ coordinate invariant ๋๋ coordinate-free geometric programming์ด๋ผ๊ณ ๋ ๋ถ๋ฆผ
(์ถ์ฒ: http://mrl.snu.ac.kr/courses/CourseGraphics/index_2017spring.html)
Points
- Point , Point
- ์ด ๋ ์ ์ ๋ํ "sum"์ ๋ฌด์์ธ๊ฐ?
If you assume coordinates, โฆ
- ํฉ:
- ์ด๊ฒ ๋ง๋๊ฐ?
- ๊ธฐํํ์ ์ผ๋ก ์๋ฏธ๊ฐ ์๋๊ฐ?
- ๋์ผํ ์ขํ ํํ์์,
- ๋ ๋จ์ํ ํฉ์ด ์๋,
์์ ์์ ์ ๊น์ง ๊ฐ๋ vector์ ํฉ์ผ๋ก ๊ฐ์ฃผํด์ผ ํจ
โ Vector sum
If you select a different origin, โฆ
- ์ ์๋ฏธ๋
์ขํ๊ณ(์์ )๊ฐ ์ด๋์ธ์ง์ ๋ฐ๋ผ ๋ฌ๋ผ์ง - ์ฆ, ๋ค๋ฅธ coordinate frame์ ์ ํํ๋ฉด ๊ฒฐ๊ณผ๋ ๋ฌ๋ผ์ง
Points and Vectors
- point๋ ์ขํ๊ฐ์ผ๋ก ์ ์๋ ์์น
- vector๋ ๋ ์ ์ฌ์ด์ ์ฐจ์ด๋ก ์ ์๋จ
- ์์ ์ด ์ ์๋์๋ค๋ฉด, point๋ ์์ ์์ ํด๋น point๊น์ง์ vector๋ก ํํ ๊ฐ๋ฅ
- ํ์ง๋ง coordinate-free ๊ด์ ์์๋ point๋ vector๊ฐ ์๋
Points & Vectors are Different!
- ์ํ์ (๋๋ ๋ฌผ๋ฆฌ์ )์ผ๋ก,
- Point๋ ๊ณต๊ฐ์์ ์์น
- Vector๋ ๊ณต๊ฐ์์ ๋ณ์
- ์๊ฐ์ ๋น์ ํ๋ฉด ๋ค์๊ณผ ๊ฐ์:
- datetime์ ์๊ฐ์ ์์น
- duration์ ์๊ฐ์ ๋ณ์
Vector and Affine Spaces
- Vector space
- ๋ฒกํฐ์ ๊ทธ ์ฐ์ฐ ํฌํจ
- ์ (points)์ ํฌํจํ์ง ์์
- Affine space
- vector space์ ์์ ๊ฐ๋
- ๋ฒกํฐ, ์ , ๊ทธ์ ๊ด๋ จ๋ ์ฐ์ฐ ๋ชจ๋ ํฌํจ
Vector spaces
- A vector space๋ ๋ค์์ผ๋ก ๊ตฌ์ฑ๋จ:
- ๋ฒกํฐ ์งํฉ๊ณผ
- ๋ ๊ฐ์ง ์ฐ์ฐ:
- ๋ฒกํฐ ๊ฐ ๋ง์
- ์ค์นผ๋ผ ๊ณฑ
Linear Combination
- ๋ฒกํฐ๋ค์ ์ ํ ๊ฒฐํฉ(linear combination) ๋ํ ๋ฒกํฐ์
Affine Spaces
- An affine space๋ ๋ค์์ผ๋ก ๊ตฌ์ฑ๋จ:
- ์ ๋ค์ ์งํฉ, ๊ด๋ จ๋ ๋ฒกํฐ ๊ณต๊ฐ
- ๋ ๊ฐ์ง ์ฐ์ฐ:
- ๋ ์ ์ ์ฐจ์ด
- ์ + ๋ฒกํฐ
Coordinate-Free Geometric Operations
- ๋ง์ (Addition)
- ๋บ์ (Subtraction)
- ์ค์นผ๋ผ ๊ณฑ (Scalar multiplication)
Addition
- : vectors
- : points
๋ผ๊ณ ํ ๋, - vector
- point
Subtraction
- vector
- vector
- point
Scalar Multiplication
- ์ค์นผ๋ผ โ
๋ฒกํฐ = ๋ฒกํฐ
- vector
- point = point
- point = vector
- point = (undefined)
Affine Frame
- A frame์ ๋ค์์ผ๋ก ์ ์๋จ:
- ๋ฒกํฐ๋ค์ ์งํฉ $ \{ \mathbf{v}_i~| ~ i = 1, \dots, N \}$
- ๊ธฐ์ค์
- ๋ฒกํฐ๋ค์ ์งํฉ ๋ ํด๋น vector space์ bases
- ๋ ํด๋น frame์ origin
- ์ affine space์ dimension
- ์์์ ์ ๋ ๋ค์๊ณผ ๊ฐ์ด ํํ๋จ:
- ์์์ ๋ฒกํฐ ๋ ๋ค์๊ณผ ๊ฐ์ด ํํ๋จ:
Summary
- Affine space์์:
Points & Vectors in Homogeneous Coordinates
- Homogeneous coordinates์์๋,
- 3D point: $ (x, y, z, \mathbf{1}) $
- 3D vector: $ (x, y, z, \mathbf{0}) $
์ด ํํ์ coordinate-free geometric programming์ ๊ฐ๋ ๊ณผ ์์ ํ๊ฒ ์ผ์นํ๋ ๋ชจ๋ธ์ ์ ๊ณตํจ
์์:
- Affine transformation matrix์ point, vector์ ๊ณฑ:
โ translation์ vector์๋ ์ ์ฉ๋์ง ์์!
Quiz 1
Coordinate System & Reference Frame
Coordinate system
- ์ ์ ์์น๋ฅผ ๊ณ ์ ํ๊ฒ ๊ฒฐ์ ํ๊ธฐ ์ํด ํ๋ ์ด์์ ์ซ์ ๋๋ ์ขํ๋ฅผ ์ฌ์ฉํ๋ ์ฒด๊ณ
Reference frame
- ์ถ์์ ์ธ ์ขํ๊ณ + ์ค์ ๊ธฐ์ค์
- ์ขํ๊ณ๋ฅผ ๊ณ ์ ์ํค๊ธฐ ์ํด ์ฌ์ฉ๋จ
์ด ๋ ์ฉ์ด๋ ์ข ์ข ํผ์ฉ๋์ง๋ง, ์๋ฏธ์๋ ์ฝ๊ฐ์ ์ฐจ์ด๊ฐ ์์
World / Body Frame (or Coordinate System)
World frame (or coordinate system)
- ์ธ๊ณ์ ๊ณ ์ ๋ ์ขํ๊ณ
- aka. global frame, fixed frame
Body frame (or coordinate system)
- ๋ฌผ์ฒด์ ๊ณ ์ ๋ ์ขํ๊ณ
- aka. local frame
Meanings of Affine Transformation Matrix
- ํ๋์ affine transformation matrix๋
์ฌ๋ฌ ๊ด์ ์์ ํด์ ๊ฐ๋ฅํจ
1) Affine Transformation Matrix Transforms a Geometry w.r.t. World Frame
ํ๋ ฌ ์ ๊ธฐํ ๊ฐ์ฒด์ ๊ฐ vertex ์์น๋ฅผ world frame ๊ธฐ์ค์์ ์๋ก์ด ์์น๋ก ๋ณํ
๋ณํ ํฌํจ: translate, rotate, scale ๋ฑ
- ์ ๊ณฑํ๋ฉด geometry๊ฐ world frame์์ ๋ค๋ฅธ ์์น๋ก ์ด๋๋ ๊ฒฐ๊ณผ๋ฅผ ์ป๊ฒ ๋จ
Review: Affine Frame
- Affine frame (3D ๊ณต๊ฐ ๊ธฐ์ค)์ ๋ค์์ผ๋ก ์ ์๋จ:
- ์ถ์ ๋ํ๋ด๋ 3๊ฐ์ ๋ฒกํฐ
- 1๊ฐ์ ์์ ์์น(์ขํ)
World Frame
- World frame์ ๋ณดํต ๋ค์์ผ๋ก ํํ๋จ:
- ํ์ค ์ถ ๋ฒกํฐ
- ์์
- ํ์ค ์ถ ๋ฒกํฐ
Letโs Transform a "World Frame"
- ์ world frame์ ๊ณฑํ๋ฉด, ๊ฐ ์ถ ๋ฒกํฐ ๋ฐ ์์ ์ด ๋ณํ๋จ:
: ์ฒซ ๋ฒ์งธ column
: ๋ ๋ฒ์งธ column
: ์ธ ๋ฒ์งธ column
: ๋ค ๋ฒ์งธ column
2) Affine Transformation Matrix Defines an Affine Frame w.r.t. World Frame
- ํ๋ ฌ ์ ๊ธฐ์ค ํ๋ ์ ๊ธฐ์ค์ผ๋ก ํํ๋ body frame ์ ์ ์
- ์ ๊ฐ column์ ๋ค์์ ๋ํ๋:
- ์์ 3๊ฐ column: ์ถ ๋ฒกํฐ
- ๋ง์ง๋ง column: ์์ ์์น
โ ์ body frame ์ world frame ๊ธฐ์ค์ผ๋ก ํํํ ๊ฒ
Examples
- ๊ฐ์ ๋ฌผ์ฒด์ body frame์ ๋ ๋ฐฉ์์ผ๋ก ์ ์:
- world frame๊ณผ ๋์ผํ ์์น์ผ ๋
- ์ด๋๋ ์์น์์ ์ ์๋ ๋
โ ๋ ๊ฒฝ์ฐ ๋ชจ๋ ์ body frame์ world ๊ธฐ์ค์ผ๋ก ํํํจ
3) Affine Transformation Matrix Transforms a Point in Body Frame to (the same) Point (but) represented in World Frame
- $ \mathbf{p}^{\{1\}} = \begin{bmatrix}1 \ 1 \ 0\end{bmatrix} $
(body frame ๊ธฐ์ค์ ์ )
- ๊ฐ์ ์ ์ world frame ๊ธฐ์ค์ผ๋ก ํํํ ๊ฒ
Why? - ๋์ผํ ๋ฌผ์ฒด๋ฅผ body frame์์ ๋ณด๋ค๊ฐ ์ ํตํด world frame ๊ธฐ์ค ํํ์ผ๋ก ๋ณํํ ๊ฒ:
- ๋จ์ํ geometry๋ฅผ ๋ณํํ ์ด์ผ๊ธฐ์
Directions of the "arrow"
- ์ฒซ ๋ฒ์งธ ์๋ฏธ
- geometry ์์ฒด๋ฅผ transform (frame์ ๊ทธ๋๋ก)
- ์ ๋ณํ์ ๋ฐฉํฅ์ ๋ํ๋:
โ ๊ฐ ๋ณํ๋์ด ์ด ๋จ.
- ๋ ๋ฒ์งธ ์๋ฏธ
- frame ์์ฒด์ ๋ณํ
- ํ๋ ์์ด ๊ธฐ์ค์ผ๋ก ์ด๋ป๊ฒ ๋ณด์ด๋์ง๋ฅผ ๋ํ๋
- ์ธ ๋ฒ์งธ ์๋ฏธ
- ๋ผ๋ ์ ์ด ํํ๋๋ ํ๋ ์ ์์ฒด๋ฅผ ๋ฐ๊พธ๋ ๊ณผ์ โ "ํํ์ ๊ธฐ์ค"์ด ๋ฐ๋: ์์ ๋ณธ ๋ฅผ ์์ ๋ณธ ๋ก ๋ณํํ๋ ๊ฒ
Quiz 2
All these concepts work even if the starting frame is not world frame!
- ์์ ํ๋ ์์ด world frame์ด ์๋์ด๋, ์ง๊ธ๊น์ง์ ๋ชจ๋ ๊ฐ๋ ์ ๊ทธ๋๋ก ์ ์ฉ ๊ฐ๋ฅ
{0} to {1}
- ์ ๋ค์์ ์ํ:
- ํ๋ ์ ๊ธฐ์ค์์ geometry๋ฅผ ๋ณํ
- ํ๋ ์ ๊ธฐ์ค์์ ํ๋ ์ ์ ์ ์
- ํ๋ ์ ๊ธฐ์ค์ ์ ์ ๊ธฐ์ค์ผ๋ก ํํ
{1} to {2}
- ๋ ๋ค์์ ์ํ:
- ํ๋ ์ ๊ธฐ์ค์์ geometry๋ฅผ ๋ณํ
- ํ๋ ์ ๊ธฐ์ค์์ ํ๋ ์ ๋ฅผ ์ ์
- ํ๋ ์ ๊ธฐ์ค์ ์ ์ ๊ธฐ์ค์ผ๋ก ํํ
{0} to {2}
- ๋ ๋ค์์ ์ํ:
- ํ๋ ์ ๊ธฐ์ค์์ geometry๋ฅผ ๋ณํ
- ํ๋ ์ ๊ธฐ์ค์์ ํ๋ ์ ๋ฅผ ์ ์
- ํ๋ ์ ๊ธฐ์ค์ ์ ์ ๊ธฐ์ค์ผ๋ก ํํ
Revisit: Order Matters!
- ์ด affine transformation์ ๋ํ๋ด๋ ํ๋ ฌ์ผ ๋:
๋จผ์ ๋ฅผ ์ ์ฉํ ๋ค, ๊ทธ ๊ฒฐ๊ณผ์ ๋ฅผ ์ ์ฉ
๋จผ์ ๋ฅผ ์ ์ฉํ ๋ค, ๊ทธ ๊ฒฐ๊ณผ์ ์ ์ ์ฉ
- โ ํ๋ ฌ์ ๊ณฑ์
์์๋ ๋งค์ฐ ์ค์ํจ!
- ๊ฒฐํฉ๋ฒ์น์ ์ฑ๋ฆฝํ์ง๋ง ๊ตํ๋ฒ์น์ ์ฑ๋ฆฝํ์ง ์์:
Composite(๋ณตํฉ) Transformations์ Interpretation(ํด์)
- ์์ transformation:
- ์ง๊ธ๊น์ง ํด์ํ๋ ๋ฐฉ์:
- ์์๋ก ์ ์ฉ
- ์ world frame ๊ธฐ์ค ๋ณํ
- ๋ค๋ฅธ ํด์ ๋ฐฉ์:
- ์์๊ฐ ์๋, ์์๋ก ํด์
- ์ฆ, body frame ๊ธฐ์ค์์ ํด์ํ๋ ๋ฐฉ์
โ ๋์ผํ ํ๋ ฌ์ด๋ผ๋ ๊ธฐ์ค ํ๋ ์์ ๋ฐ๋ผ ํด์์ด ๋ฌ๋ผ์ง ์ ์์
Pre-(left) & Post-(right) Multiplication
Pre-multiplication:
โ Right-to-Left ์์
- ๋ฅผ world frame ๊ธฐ์ค์ผ๋ก ์ ์ฉํ์ฌ ๋ฅผ ๋ณํ
- ๊ทธ ๊ฒฐ๊ณผ์ ์ ๋ค์ world frame ๊ธฐ์ค์ผ๋ก ์ ์ฉ
โ ์ ์ฒด ๋ณํ์
Post-multiplication:
โ Left-to-Right ์์
- ๋ body frame ๊ธฐ์ค์์ ํํ๋์ด ์์
- ์ body frame ์ world frame ๊ธฐ์ค์ผ๋ก ์ ๋ฐ์ดํธํจ
- ๋ ์ด์ด์ body frame ๋ก ์ ๋ฐ์ดํธํจ
- ๊ฒฐ๊ณผ์ ์ผ๋ก ๋ body frame ๊ธฐ์ค์์ ํํ๋จ
โ ์ ์ฒด ๋ณํ์ ์ฌ์ ํ
๋ ๋ค๋ฅธ ์ ์ฉํ ํด์๋ฒ
- : world frame ๊ธฐ์ค์ผ๋ก ์ ์ฉํ์ฌ body frame์ ์ผ๋ก ์ ๋ฐ์ดํธ
- : ๋ค์ world frame ๊ธฐ์ค์ผ๋ก ์ ์ฉํ์ฌ body frame์ ๋ก ์ ๋ฐ์ดํธ
- ๋ฅผ ์๋ก์ด body frame ๊ธฐ์ค์ผ๋ก ์์น์ํด
[Demo] L-to-R & R-to-L Interpretation
observablehq.com/@esperanc/transformation-demo
- ๋ค์ํ ์์๋ก translation ๋ฐ ์ ํ ๋ณํ ์ถ๊ฐ ( '+' ๋ฒํผ ์ฌ์ฉ)
- ์ฌ๋ผ์ด๋๋ฅผ ๋๋๊ทธํ์ฌ ํ๋ ฌ ๊ฐ์ ๋ณํ ๋ฐ ๋ํ์ ๋ณํ๋ฅผ ๊ด์ฐฐ
- ํฉ์ฑ ๋ณํ์ ์๋ฏธ๋ฅผ L-to-R, R-to-L ์์๋ก ํด์ํด๋ณด์ธ์

