Pourquoi transformons-nous des vecteurs 3D avec des matrices 4x4?

Pourquoi pas une matrice 3x3? Pourquoi tout est-il organisé dans une matrice 4x4 exactement comme ça? Pourquoi la dernière ligne est-elle remplie de zéros et d'un à la fin? J'ai posé ces questions la veille, j'ai décidé d'enquêter sur la question et de dire ce que j'ai découvert.





Dans l'article, nous ne nous intéresserons qu'aux transformations affines, et en particulier la rotation, la mise à l'échelle et le mouvement, qui sont activement utilisés dans la programmation graphique et le développement de jeux en général.





: . , , , (A⋅x). , , , (+b).





T, x





T (\ vec {x}) = A \ vec {x} + \ vec {b}

, b x . x x', :





\ begin {array} {ll} A \ rightarrow [a] \ rightarrow a, \\ \ vec {b} \ rightarrow (b) \ rightarrow b, \\ \ vec {x} \ rightarrow x, \\ T (x ) \ rightarrow x '\ end {tableau}





x '= hache + b

x ( ), b ( ).





, , . M, :





x '= ax + b = M (x)

x' = 3x + 4 (3x +4 ) .





\ begin {array} {ll} Mx = 3x + 4 \\ M = (3x + 4) / x \\ M = 3 + (\ frac {4} {x}) \ end {array}

, ( 3x [3]), (x+4) , M x.





:

+4 +4y, y, x ,





x '= 3x + 4y \\ y' = \ _x + \ _y

2x2, x' = 3x+4 x, . . , .





\ begin {bmatrix} x '\\ y' \ end {bmatrix} = \ begin {bmatrix} 3 & 4 \\ \ _ & \ _ \ end {bmatrix} \ begin {bmatrix} x \\ y \ end {bmatrix }

2x2 , , - y, +4y , +4, x :





\ begin {bmatrix} x '\\ y' \ end {bmatrix} = \ begin {bmatrix} 3 & 4 \\ \ _ & \ _ \ end {bmatrix} \ begin {bmatrix} x \\ 1 \ end {bmatrix } \ rightarrow \ begin {array} {l} x '= 3 \ cdot x + 4 \ cdot 1 \\ y' = \ _ \ cdot x + \ _ \ cdot 1 \ end {array}

, , , , 3x+4 x' - y' y' ,





\ begin {bmatrix} x '\\ 1 \ end {bmatrix}

. : y' = 1 = 0 ⋅ x + 1 ⋅ 1





\ begin {bmatrix} x '\\ 1 \ end {bmatrix} = \ begin {bmatrix} 3 & 4 \\ 0 & 1 \ end {bmatrix} \ begin {bmatrix} x \\ 1 \ end {bmatrix}

, x , .





\ begin {bmatrix} a & b \\ 0 & 1 \ end {bmatrix}

(a), (b) (0 1) y' 1, x' , .





- , , . ():





\ begin {bmatrix} 3 & 4 \\ 0 & 1 \ end {bmatrix} \ begin {bmatrix} 1 \\ 1 \ end {bmatrix} = \ begin {bmatrix} 7 \\ 1 \ end {bmatrix}

,





, , - z, y .





22 . b .





x' y' , , z' 1 .





, () , () :





:












All Articles