# 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 $\mathbf{p}$, Point $\mathbf{q}$
  • ์ด ๋‘ ์ ์„ ๋”ํ•œ "sum"์€ ๋ฌด์—‡์ธ๊ฐ€?

# If you assume coordinates, โ€ฆ

  • $\mathbf{p} = (x_1,~y_1)$
  • $\mathbf{q} = (x_2,~y_2)$
  • ํ•ฉ: $(x_1+x_2,~y_1+y_2)$
    • ์ด๊ฒŒ ๋งž๋Š”๊ฐ€?
    • ๊ธฐํ•˜ํ•™์ ์œผ๋กœ ์˜๋ฏธ๊ฐ€ ์žˆ๋Š”๊ฐ€?
  • ๋™์ผํ•œ ์ขŒํ‘œ ํ‘œํ˜„์—์„œ,
  • $\mathbf{p} = (x_1,~y_1)$
  • $\mathbf{q} = (x_2,~y_2)$
  • $(x_1+x_2,~y_1+y_2)$๋Š” ๋‹จ์ˆœํ•œ ํ•ฉ์ด ์•„๋‹Œ,
    ์›์ ์—์„œ $\mathbf{p}$์™€ $\mathbf{q}$๊นŒ์ง€ ๊ฐ€๋Š” vector์˜ ํ•ฉ์œผ๋กœ ๊ฐ„์ฃผํ•ด์•ผ ํ•จ
    โ†’ Vector sum

# If you select a different origin, โ€ฆ

  • $\mathbf{p} = (x_1,~y_1)$
  • $\mathbf{q} = (x_2,~y_2)$
  • $(x_1+x_2,~y_1+y_2)$์˜ ์˜๋ฏธ๋Š”
    ์ขŒํ‘œ๊ณ„(์›์ )๊ฐ€ ์–ด๋””์ธ์ง€์— ๋”ฐ๋ผ ๋‹ฌ๋ผ์ง
  • ์ฆ‰, ๋‹ค๋ฅธ 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) ๋˜ํ•œ ๋ฒกํ„ฐ์ž„

$$ \mathbf{u}_0, \mathbf{u}_1, \dots, \mathbf{u}_n \in V \\ \Rightarrow c_0 \mathbf{u}_0 + c_1 \mathbf{u}_1 + \dots + c_n \mathbf{u}_n \in V $$

# Affine Spaces

  • An affine space๋Š” ๋‹ค์Œ์œผ๋กœ ๊ตฌ์„ฑ๋จ:
    • ์ ๋“ค์˜ ์ง‘ํ•ฉ, ๊ด€๋ จ๋œ ๋ฒกํ„ฐ ๊ณต๊ฐ„
    • ๋‘ ๊ฐ€์ง€ ์—ฐ์‚ฐ:
      • ๋‘ ์ ์˜ ์ฐจ์ด
      • ์  + ๋ฒกํ„ฐ

# Coordinate-Free Geometric Operations

  • ๋ง์…ˆ (Addition)
  • ๋บ„์…ˆ (Subtraction)
  • ์Šค์นผ๋ผ ๊ณฑ (Scalar multiplication)

# Addition

  • $\mathbf{u}, \mathbf{v}, \mathbf{w}$: vectors
  • $\mathbf{p}, \mathbf{q}$: points
    ๋ผ๊ณ  ํ•  ๋•Œ,
  • $\mathbf{u} + \mathbf{v} \rightarrow$ vector
  • $\mathbf{p} + \mathbf{w} \rightarrow$ point

# Subtraction

  • $\mathbf{u} - \mathbf{v} \rightarrow$ vector
  • $\mathbf{p} - \mathbf{q} \rightarrow$ vector
  • $\mathbf{p} - \mathbf{w} \rightarrow$ point

# Scalar Multiplication

  • ์Šค์นผ๋ผ โ‹… ๋ฒกํ„ฐ = ๋ฒกํ„ฐ
    • $c \cdot \mathbf{v} \rightarrow$ vector
  • $1 \cdot$ point = point
  • $0 \cdot$ point = vector
  • $c \cdot$ point = (undefined) $~\text{if} ~(c \neq 0,~1)$

# Affine Frame

  • A frame์€ ๋‹ค์Œ์œผ๋กœ ์ •์˜๋จ:
    • ๋ฒกํ„ฐ๋“ค์˜ ์ง‘ํ•ฉ $ \{ \mathbf{v}_i~| ~ i = 1, \dots, N \}$
    • ๊ธฐ์ค€์  $\mathbf{o}$
  • ๋ฒกํ„ฐ๋“ค์˜ ์ง‘ํ•ฉ ${\mathbf{v}_i}$๋Š” ํ•ด๋‹น vector space์˜ bases
  • $\mathbf{o}$๋Š” ํ•ด๋‹น frame์˜ origin
  • $N$์€ affine space์˜ dimension
  • ์ž„์˜์˜ ์  $\mathbf{p}$๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์ด ํ‘œํ˜„๋จ: $$ \mathbf{p} = \mathbf{o} + c_1 \mathbf{v}_1 + c_2 \mathbf{v}_2 + \dots + c_n \mathbf{v}_n $$
  • ์ž„์˜์˜ ๋ฒกํ„ฐ $\mathbf{v}$๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์ด ํ‘œํ˜„๋จ: $$ \mathbf{v} = c_1 \mathbf{v}_1 + c_2 \mathbf{v}_2 + \dots + c_n \mathbf{v}_n $$

# Summary

  • Affine space์—์„œ: $$ \begin{aligned} \mathbf{p} + \mathbf{p} & = \text{(undefined)} \\ \mathbf{p} - \mathbf{p} & = \text{vector} \\ \mathbf{p} \pm \mathbf{v} & = \text{point} \\ \mathbf{v} \pm \mathbf{v} & = \text{vector} \\ c \cdot \mathbf{v} & = \text{vector} \\ 1 \cdot \mathbf{p} & = \text{point} \\ 0 \cdot \mathbf{p} & = \text{vector} \\ c \cdot \mathbf{p} & = \text{(undefined)} \quad (c \neq 0, 1) \end{aligned} $$

# 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์˜ ๊ฐœ๋…๊ณผ ์™„์ „ํ•˜๊ฒŒ ์ผ์น˜ํ•˜๋Š” ๋ชจ๋ธ์„ ์ œ๊ณตํ•จ

์˜ˆ์‹œ: $$ (x_1, y_1, z_1, 1) + (x_2, y_2, z_2, 1) \\= (x_1 + x_2, y_1 + y_2, z_1 + z_2, 2) \text{โ†’ point (undefined)} $$

$$ (x_1, y_1, z_1, 1) - (x_2, y_2, z_2, 1) \\= (x_1 - x_2, y_1 - y_2, z_1 - z_2, 0) \text{โ†’ vector} $$

$$ (x_1, y_1, z_1, 1) + (x_2, y_2, z_2, 0) \\= (x_1 + x_2, y_1 + y_2, z_1 + z_2, 1) \text{โ†’ point} $$

$$ (x_1, y_1, z_1, 0) + (x_2, y_2, z_2, 0) \\= (x_1 + x_2, y_1 + y_2, z_1 + z_2, 0) \text{โ†’ vector} $$

$$ c \cdot (x, y, z, 0) \\= (cx, cy, cz, 0) \text{โ†’ vector} $$

$$ c \cdot (x, y, z, 1) \\= (cx, cy, cz, c) \text{โ†’} \begin{cases} \text{point} & \text{if } c = 1 \\ \text{vector} & \text{if } c = 0 \\ \text{undefined} & \text{if } c \ne 0, 1 \end{cases} $$

  • Affine transformation matrix์™€ point, vector์˜ ๊ณฑ:

$$ \begin{bmatrix} \mathbf{M} & \mathbf{t} \\ \mathbf{0}^\mathrm{T} & 1 \end{bmatrix} \begin{bmatrix} \mathbf{p} \\ 1 \end{bmatrix} = \begin{bmatrix} \mathbf{M} \mathbf{p} + \mathbf{t} \\ 1 \end{bmatrix} \text{โ†’ point} $$

$$ \begin{bmatrix} \mathbf{M} & \mathbf{t} \\ \mathbf{0}^\mathrm{T} & 1 \end{bmatrix} \begin{bmatrix} \mathbf{v} \\ 0 \end{bmatrix} = \begin{bmatrix} \mathbf{M} \mathbf{v} \\ 0 \end{bmatrix} \text{โ†’ 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

  • ํ–‰๋ ฌ $\mathbf{M}$์€ ๊ธฐํ•˜ ๊ฐ์ฒด์˜ ๊ฐ vertex ์œ„์น˜๋ฅผ world frame ๊ธฐ์ค€์—์„œ ์ƒˆ๋กœ์šด ์œ„์น˜๋กœ ๋ณ€ํ™˜

  • ๋ณ€ํ™˜ ํฌํ•จ: translate, rotate, scale ๋“ฑ

$$ \mathbf{M} = \begin{bmatrix} m_{11} & m_{12} & m_{13} & u_x \\ m_{21} & m_{22} & m_{23} & u_y \\ m_{31} & m_{32} & m_{33} & u_z \\ 0 & 0 & 0 & 1 \end{bmatrix} $$

  • $\mathbf{M}$์„ ๊ณฑํ•˜๋ฉด geometry๊ฐ€ world frame์—์„œ ๋‹ค๋ฅธ ์œ„์น˜๋กœ ์ด๋™๋œ ๊ฒฐ๊ณผ๋ฅผ ์–ป๊ฒŒ ๋จ

# Review: Affine Frame

  • Affine frame (3D ๊ณต๊ฐ„ ๊ธฐ์ค€)์€ ๋‹ค์Œ์œผ๋กœ ์ •์˜๋จ:
    • $x,~y,~z$์ถ•์„ ๋‚˜ํƒ€๋‚ด๋Š” 3๊ฐœ์˜ ๋ฒกํ„ฐ
    • 1๊ฐœ์˜ ์›์  ์œ„์น˜(์ขŒํ‘œ)

# World Frame

  • World frame์€ ๋ณดํ†ต ๋‹ค์Œ์œผ๋กœ ํ‘œํ˜„๋จ:
    • ํ‘œ์ค€ ์ถ• ๋ฒกํ„ฐ
      $$ \hat{\mathbf{e}}_x = \begin{bmatrix}1 \\ 0 \\ 0\end{bmatrix}~ \hat{\mathbf{e}}_y = \begin{bmatrix}0 \\ 1 \\ 0\end{bmatrix}~ \hat{\mathbf{e}}_z = \begin{bmatrix}0 \\ 0 \\ 1\end{bmatrix} $$
    • ์›์ 
      $$ \mathbf{0}= \begin{bmatrix}0 \\ 0 \\ 0\end{bmatrix} $$

# Letโ€™s Transform a "World Frame"

  • $\mathbf{M}$์„ world frame์— ๊ณฑํ•˜๋ฉด, ๊ฐ ์ถ• ๋ฒกํ„ฐ ๋ฐ ์›์ ์ด ๋ณ€ํ™˜๋จ:

$ \text{x-axis:} \quad \mathbf{M} \begin{bmatrix}1 \\ 0 \\ 0 \\ 0\end{bmatrix} $ : ์ฒซ ๋ฒˆ์งธ column

$ \text{y-axis:} \quad \mathbf{M} \begin{bmatrix}0 \\ 1 \\ 0 \\ 0\end{bmatrix} $ : ๋‘ ๋ฒˆ์งธ column

$ \text{z-axis:} \quad \mathbf{M} \begin{bmatrix}0 \\ 0 \\ 1 \\ 0\end{bmatrix} $ : ์„ธ ๋ฒˆ์งธ column

$ \text{origin:} \quad \mathbf{M} \begin{bmatrix}0 \\ 0 \\ 0 \\ 1\end{bmatrix} $ : ๋„ค ๋ฒˆ์งธ column

# 2) Affine Transformation Matrix Defines an Affine Frame w.r.t. World Frame

  • ํ–‰๋ ฌ $\mathbf{M}$์€ ๊ธฐ์ค€ ํ”„๋ ˆ์ž„ $\{0\}$ ๊ธฐ์ค€์œผ๋กœ ํ‘œํ˜„๋œ body frame $\{1\}$์„ ์ •์˜
  • $\mathbf{M}$์˜ ๊ฐ column์€ ๋‹ค์Œ์„ ๋‚˜ํƒ€๋ƒ„:
    • ์•ž์˜ 3๊ฐœ column: ์ถ• ๋ฒกํ„ฐ
    • ๋งˆ์ง€๋ง‰ column: ์›์  ์œ„์น˜

โ†’ $\mathbf{M}$์€ body frame $\{1\}$์„ world frame $\{0\}$ ๊ธฐ์ค€์œผ๋กœ ํ‘œํ˜„ํ•œ ๊ฒƒ

# Examples

  • ๊ฐ™์€ ๋ฌผ์ฒด์˜ body frame์„ ๋‘ ๋ฐฉ์‹์œผ๋กœ ์ •์˜:
    1. world frame๊ณผ ๋™์ผํ•œ ์œ„์น˜์ผ ๋•Œ
    2. ์ด๋™๋œ ์œ„์น˜์—์„œ ์ •์˜๋  ๋•Œ

โ†’ ๋‘ ๊ฒฝ์šฐ ๋ชจ๋‘ $\mathbf{M}$์€ 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 $\{1\}$ ๊ธฐ์ค€์˜ ์ ) $$ \mathbf{p}^{\{0\}} = \mathbf{M} \cdot \mathbf{p}^{\{1\}} $$
  • ๊ฐ™์€ ์ ์„ world frame $\{0\}$ ๊ธฐ์ค€์œผ๋กœ ํ‘œํ˜„ํ•œ ๊ฒƒ
    Why?
  • ๋™์ผํ•œ ๋ฌผ์ฒด๋ฅผ body frame์—์„œ ๋ณด๋‹ค๊ฐ€ $\mathbf{M}$์„ ํ†ตํ•ด world frame ๊ธฐ์ค€ ํ‘œํ˜„์œผ๋กœ ๋ณ€ํ™˜ํ•œ ๊ฒƒ: $$ \mathbf{p}^{\{0\}} = \mathbf{M} \cdot \mathbf{p}^{\{1\}} $$
  • ๋‹จ์ˆœํžˆ geometry๋ฅผ ๋ณ€ํ™˜ํ•œ ์ด์•ผ๊ธฐ์ž„

# Directions of the "arrow"

  • ์ฒซ ๋ฒˆ์งธ ์˜๋ฏธ
    • geometry ์ž์ฒด๋ฅผ transform (frame์€ ๊ทธ๋Œ€๋กœ)
    • $\mathbf{M}$์€ ๋ณ€ํ™˜์˜ ๋ฐฉํ–ฅ์„ ๋‚˜ํƒ€๋ƒ„: ${\{0\}}\rightarrow{\{1\}}$
      โ†’ $\mathbf{p}^{\{0\}}$๊ฐ€ ๋ณ€ํ™˜๋˜์–ด $\mathbf{p}^{\{1\}}$์ด ๋จ.
  • ๋‘ ๋ฒˆ์งธ ์˜๋ฏธ
    • frame ์ž์ฒด์˜ ๋ณ€ํ™˜
    • ${\{1\}}$ ํ”„๋ ˆ์ž„์ด ${\{0\}}$ ๊ธฐ์ค€์œผ๋กœ ์–ด๋–ป๊ฒŒ ๋ณด์ด๋Š”์ง€๋ฅผ ๋‚˜ํƒ€๋ƒ„
  • ์„ธ ๋ฒˆ์งธ ์˜๋ฏธ
    • $\mathbf{p}$๋ผ๋Š” ์ ์ด ํ‘œํ˜„๋˜๋Š” ํ”„๋ ˆ์ž„ ์ž์ฒด๋ฅผ ๋ฐ”๊พธ๋Š” ๊ณผ์ • โ†’ "ํ‘œํ˜„์˜ ๊ธฐ์ค€"์ด ๋ฐ”๋€œ: $\{0\}$์—์„œ ๋ณธ $\mathbf{p}$๋ฅผ $\{1\}$์—์„œ ๋ณธ $\mathbf{p}$๋กœ ๋ณ€ํ™˜ํ•˜๋Š” ๊ฒƒ

# Quiz 2

# All these concepts work even if the starting frame is not world frame!

  • ์‹œ์ž‘ ํ”„๋ ˆ์ž„์ด world frame์ด ์•„๋‹ˆ์–ด๋„, ์ง€๊ธˆ๊นŒ์ง€์˜ ๋ชจ๋“  ๊ฐœ๋…์€ ๊ทธ๋Œ€๋กœ ์ ์šฉ ๊ฐ€๋Šฅ

# {0} to {1}

  • $\mathbf{M}_1$์€ ๋‹ค์Œ์„ ์ˆ˜ํ–‰:
    1. ํ”„๋ ˆ์ž„ $\{0\}$ ๊ธฐ์ค€์—์„œ geometry๋ฅผ ๋ณ€ํ™˜
    2. ํ”„๋ ˆ์ž„ $\{0\}$ ๊ธฐ์ค€์—์„œ ํ”„๋ ˆ์ž„ $\{1\}$์„ ์ •์˜
    3. ํ”„๋ ˆ์ž„ $\{1\}$ ๊ธฐ์ค€์˜ ์ ์„ $\{0\}$ ๊ธฐ์ค€์œผ๋กœ ํ‘œํ˜„
      $$ \mathbf{p}^{\{0\}} = \mathbf{M}_1 \cdot \mathbf{p}^{\{1\}} $$

# {1} to {2}

  • $\mathbf{M}_2$๋Š” ๋‹ค์Œ์„ ์ˆ˜ํ–‰:
    1. ํ”„๋ ˆ์ž„ $\{1\}$ ๊ธฐ์ค€์—์„œ geometry๋ฅผ ๋ณ€ํ™˜
    2. ํ”„๋ ˆ์ž„ $\{1\}$ ๊ธฐ์ค€์—์„œ ํ”„๋ ˆ์ž„ ๋ฅผ ์ •์˜
    3. ํ”„๋ ˆ์ž„ $\{2\}$ ๊ธฐ์ค€์˜ ์ ์„ $\{1\}$ ๊ธฐ์ค€์œผ๋กœ ํ‘œํ˜„
      $$ \mathbf{p}^{\{1\}} = \mathbf{M}_2 \cdot \mathbf{p}^{\{2\}} $$

# {0} to {2}

  • $\mathbf{M}_1 \mathbf{M}_2$๋Š” ๋‹ค์Œ์„ ์ˆ˜ํ–‰:
    1. ํ”„๋ ˆ์ž„ $\{0\}$ ๊ธฐ์ค€์—์„œ geometry๋ฅผ ๋ณ€ํ™˜
    2. ํ”„๋ ˆ์ž„ $\{0\}$ ๊ธฐ์ค€์—์„œ ํ”„๋ ˆ์ž„ $\{2\}$๋ฅผ ์ •์˜
    3. ํ”„๋ ˆ์ž„ $\{2\}$ ๊ธฐ์ค€์˜ ์ ์„ $\{0\}$ ๊ธฐ์ค€์œผ๋กœ ํ‘œํ˜„
      $$ \mathbf{p}^{\{0\}} = \mathbf{M}_1 \cdot \mathbf{M}_2 \cdot \mathbf{p}^{\{2\}} $$

# Revisit: Order Matters!

  • $\mathbf{T}, \mathbf{R}$์ด affine transformation์„ ๋‚˜ํƒ€๋‚ด๋Š” ํ–‰๋ ฌ์ผ ๋•Œ: $$ \mathbf{p}' = \mathbf{T} \cdot \mathbf{R} \cdot \mathbf{p} \\\Rightarrow \text{ ๋จผ์ € } \mathbf{R}(\mathbf{p}) \text{ ์ ์šฉ, ๊ทธ ํ›„ } \mathbf{T} $$ $$ \mathbf{p}' = \mathbf{R} \cdot \mathbf{T} \cdot \mathbf{p} \\\Rightarrow \text{ ๋จผ์ € } \mathbf{T}(\mathbf{p}) \text{ ์ ์šฉ, ๊ทธ ํ›„ } \mathbf{R} $$
  • โ†’ ํ–‰๋ ฌ์˜ ๊ณฑ์…ˆ ์ˆœ์„œ๋Š” ๋งค์šฐ ์ค‘์š”ํ•จ!
    • ๊ฒฐํ•ฉ๋ฒ•์น™์€ ์„ฑ๋ฆฝํ•˜์ง€๋งŒ ๊ตํ™˜๋ฒ•์น™์€ ์„ฑ๋ฆฝํ•˜์ง€ ์•Š์Œ: $AB \ne BA$

# Composite(๋ณตํ•ฉ) Transformations์˜ Interpretation(ํ•ด์„)

  • ์˜ˆ์‹œ transformation:
    $$ \mathbf{M} = \mathbf{T}(x,~3) \cdot \mathbf{R}(-90^\circ) $$
  • ์ง€๊ธˆ๊นŒ์ง€ ํ•ด์„ํ–ˆ๋˜ ๋ฐฉ์‹:
    • $\mathbf{R} \rightarrow \mathbf{T}$ ์ˆœ์„œ๋กœ ์ ์šฉ
    • $\mathbf{R}$์€ world frame ๊ธฐ์ค€ ๋ณ€ํ™˜ $$ \mathbf{p} \xrightarrow{\mathbf{R}(-90^\circ)} \mathbf{R}(\mathbf{p}) \\\xrightarrow{\mathbf{T}(x, 3)} \mathbf{p}' = \mathbf{T}(\mathbf{R}(\mathbf{p})) $$
  • ๋‹ค๋ฅธ ํ•ด์„ ๋ฐฉ์‹:
    • $\mathbf{R} \rightarrow \mathbf{T}$ ์ˆœ์„œ๊ฐ€ ์•„๋‹Œ, $\mathbf{T} \rightarrow \mathbf{R}$ ์ˆœ์„œ๋กœ ํ•ด์„
    • ์ฆ‰, body frame ๊ธฐ์ค€์—์„œ ํ•ด์„ํ•˜๋Š” ๋ฐฉ์‹ $$ \mathbf{p} \rightarrow \mathbf{T}(\mathbf{p}) \rightarrow \mathbf{R}(\mathbf{T}(\mathbf{p})) = \mathbf{M}(\mathbf{p}) = \mathbf{p}' $$ โ†’ ๋™์ผํ•œ ํ–‰๋ ฌ์ด๋ผ๋„ ๊ธฐ์ค€ ํ”„๋ ˆ์ž„์— ๋”ฐ๋ผ ํ•ด์„์ด ๋‹ฌ๋ผ์งˆ ์ˆ˜ ์žˆ์Œ

# Pre-(left) & Post-(right) Multiplication

# Pre-multiplication:

$$ \mathbf{p}' = \mathbf{M}_1 \cdot \mathbf{M}_2 \cdot \mathbf{p} \\ (\text{pre-multiplication by } \mathbf{M}_1) $$

โ†’ Right-to-Left ์ˆœ์„œ

  1. $\mathbf{M}_2$๋ฅผ world frame ๊ธฐ์ค€์œผ๋กœ ์ ์šฉํ•˜์—ฌ $\mathbf{p}$๋ฅผ ๋ณ€ํ™˜
  2. ๊ทธ ๊ฒฐ๊ณผ์— $\mathbf{M}_1$์„ ๋‹ค์‹œ world frame ๊ธฐ์ค€์œผ๋กœ ์ ์šฉ

โ†’ ์ „์ฒด ๋ณ€ํ™˜์€ $\mathbf{M}_1 \mathbf{M}_2$

# Post-multiplication:

$$ \mathbf{p}' = \mathbf{M}_1 \cdot \mathbf{M}_2 \cdot \mathbf{p} \\ (\text{post-multiplication by } \mathbf{M}_1) $$

โ†’ Left-to-Right ์ˆœ์„œ

  1. $\mathbf{p}$๋Š” body frame $\{1\}$ ๊ธฐ์ค€์—์„œ ํ‘œํ˜„๋˜์–ด ์žˆ์Œ
  2. $\mathbf{M}_1$์€ body frame $\{1\}$์„ world frame ๊ธฐ์ค€์œผ๋กœ ์—…๋ฐ์ดํŠธํ•จ
  3. $\mathbf{M}_2$๋Š” ์ด์–ด์„œ body frame $\{2\}$๋กœ ์—…๋ฐ์ดํŠธํ•จ
  4. ๊ฒฐ๊ณผ์ ์œผ๋กœ $\mathbf{p}$๋Š” body frame $\{2\}$ ๊ธฐ์ค€์—์„œ ํ‘œํ˜„๋จ

โ†’ ์ „์ฒด ๋ณ€ํ™˜์€ ์—ฌ์ „ํžˆ $\mathbf{M}_1 \mathbf{M}_2$

# ๋˜ ๋‹ค๋ฅธ ์œ ์šฉํ•œ ํ•ด์„๋ฒ•

  1. $\mathbf{M}_1$: world frame ๊ธฐ์ค€์œผ๋กœ ์ ์šฉํ•˜์—ฌ body frame์„ $\mathbf{M}_1$์œผ๋กœ ์—…๋ฐ์ดํŠธ
  2. $\mathbf{M}_2$: ๋‹ค์‹œ world frame ๊ธฐ์ค€์œผ๋กœ ์ ์šฉํ•˜์—ฌ body frame์„ $\mathbf{M}_1 \mathbf{M}_2$๋กœ ์—…๋ฐ์ดํŠธ
  3. $\mathbf{p}$๋ฅผ ์ƒˆ๋กœ์šด body frame $\mathbf{M}_1 \mathbf{M}_2$ ๊ธฐ์ค€์œผ๋กœ ์œ„์น˜์‹œํ‚ด

# [Demo] L-to-R & R-to-L Interpretation

observablehq.com/@esperanc/transformation-demo (opens new window)

  • ๋‹ค์–‘ํ•œ ์ˆœ์„œ๋กœ translation ๋ฐ ์„ ํ˜• ๋ณ€ํ™˜ ์ถ”๊ฐ€ ( '+' ๋ฒ„ํŠผ ์‚ฌ์šฉ)
  • ์Šฌ๋ผ์ด๋”๋ฅผ ๋“œ๋ž˜๊ทธํ•˜์—ฌ ํ–‰๋ ฌ ๊ฐ’์˜ ๋ณ€ํ™” ๋ฐ ๋„ํ˜•์˜ ๋ณ€ํ™”๋ฅผ ๊ด€์ฐฐ
  • ํ•ฉ์„ฑ ๋ณ€ํ™˜์˜ ์˜๋ฏธ๋ฅผ L-to-R, R-to-L ์ˆœ์„œ๋กœ ํ•ด์„ํ•ด๋ณด์„ธ์š”