4 types of transformation
Translation
point vector + translation vector → new targeted point vector
$\begin{bmatrix} x'\\ y' \end{bmatrix} = \begin{bmatrix} T_x \\ T_y \end{bmatrix} +\begin{bmatrix} x\\ y \end{bmatrix}$
this can also be written in multiplication form so we can combine the translation along with other operations
$\begin{bmatrix} x'\\ y'\\ w' \end{bmatrix} = \begin{bmatrix} 1 & 0 & t_x\\ 0 & 1 & t_y \\ 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} x\\ y\\ 1 \end{bmatrix}$
and the point is in homogeneous form
Scaling with respect to origin
$\begin{bmatrix} x'\\ y' \end{bmatrix} = \begin{bmatrix} S_x & 0\\ 0 & S_y \end{bmatrix} \begin{bmatrix} x\\ y \end{bmatrix}$
Rotation in counter-clockwise
$\begin{bmatrix} x'\\ y' \end{bmatrix} = \begin{bmatrix} cos\theta & -sin\theta\\ sin\theta & cos\theta \end{bmatrix} \begin{bmatrix} x\\ y \end{bmatrix}$
Shearing
Horizontal shear:
$\begin{bmatrix} x'\\ y' \end{bmatrix} = \begin{bmatrix} 1 & k\\ 0 & 1 \end{bmatrix} \begin{bmatrix} x\\ y \end{bmatrix}$
Vertical shear
$\begin{bmatrix} x'\\ y' \end{bmatrix} = \begin{bmatrix} 1 & 0\\k & 1 \end{bmatrix} \begin{bmatrix} x\\ y \end{bmatrix}$
Share in 3D homogeneous form
$\begin{bmatrix} x'\\ y'\\ z'\\ w' \end{bmatrix} = \begin{bmatrix} 1 & 0 & a & 0\\ 0 & 1 &b & 0 \\ 0 & 0 & 1& 0 \\ 0 & 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} x\\ y\\ z\\ 1 \end{bmatrix}$
Transform 2-4 to homogeneous form is trivial, just make it 3x3 matrix and fill the rest slot with 0 except the bottom-right one.
3D rotation
around z $\begin{bmatrix} cos\theta & -sin\theta & 0 & 0\\ sin\theta & cos\theta &0 & 0 \\ 0 & 0 & 1& 0 \\ 0 & 0 & 0 & 1 \end{bmatrix}$ around x $\begin{bmatrix} 1 & 0 & 0 & 0\\ 0& cos\theta & -sin\theta & 0 \\ 0 & sin\theta & cos\theta& 0 \\ 0 & 0 & 0 & 1 \end{bmatrix}$
around y $\begin{bmatrix} cos\theta & 0 & sin\theta & 0\\ 0 & 1 &0 & 0 \\ -sin\theta & 0 & cos\theta& 0 \\ 0 & 0 & 0 & 1 \end{bmatrix}$
orthonormal matrices preserve lengths, angles, ration of side lengths
Affine Transformation(shear, scale): parallelism of lines and planes, ration of edge lengths are preserved
rigid body transformation: a mapping from “this” set to another subset of the Euclidean space, such that the Euclidean distances between points are preserved.
Transforming a vector/normal:
To rotate around an arbitrary axis in the space, we just need to rotate that axis to any existing axis and perform the rotation, then rotate the axis back
An orthonormal vector:
each vector has the length of 1 and they are all perpendicular to each other(dot product between any 2 of them is 0)
To represent a point in a different coordinate system, we can first transform the original basis to the new basis, call it $T$, and the new point in new coordinate system would be $T^{-1}P$ where $P$ is the old coordinate for the point.
Rotation’s inverse → transpose