Points represent positions: | Vectors represent directions: | |
\(p = (x, y)\)
|
\(\vec v = (x, y)\)
|
|
Typically write both as column vectors: | ||
\[x = \begin{pmatrix}x \\ y \end{pmatrix}\] | \[\vec v = \begin{pmatrix}x \\ y \end{pmatrix}\] |
Vector addition: | Point Subtraction: | |
\(\vec v_1 = (x_1, y_1)\)
\(\vec v_2 = (x_2, y_2)\)
\(\vec v = \vec v_1 + \vec v_2\)
|
\(p_1\)
\(p_2\)
\(\vec v = p_2 - p_1\)
|
|
\[\vec v = \begin{pmatrix}x_1 + x_2 \\ y_1 + y_2 \end{pmatrix}\] | \[\vec v = \begin{pmatrix}x_2 - x_1 \\ y_2 - y_1 \end{pmatrix}\] |
\(\theta\)
\(\vec v_1\)
\(\vec v_2\)
|
A dot product can be thought of as the length of the projection of one vector onto the other vector. | |
\(\theta\)
\(\vec v_1\)
\(\vec v_2\)
\(\left |\vec v_1 \times \vec v_2\right |\)
|
\(
\left | \vec v_1 \times \vec v_2 \right | = \left |\vec v_1 \right | \left |\vec v_2 \right | \sin \theta
\) \(\vec v_1 \times \vec v_2\) is orthogonal (perpendicular) to both \(\vec v_1\) and \(\vec v_2\,\); length is area of parallelogram. Cross product is only defined for 3Dimensional vectors! |
|
|
Scale by \((s_x, s_y)\): \[ \begin{pmatrix} \color{blue}{s_x} & 0 \\ 0 & \color{blue}{s_y} \end{pmatrix} \begin{pmatrix} x \\ y \end{pmatrix} \] | ||
|
|||
\[ \underbrace{ \begin{pmatrix} \color{blue}{\class{sxval}{1}} & 0 \\ 0 & \color{blue}{\class{syval}{1}} \end{pmatrix}}_{\color{blue}{\large S}} \begin{pmatrix} x \\ y \end{pmatrix} \] |
|
Scale by \((s_x, s_y)\): \[ \begin{pmatrix} \color{blue}{s_x} & 0 \\ 0 & \color{blue}{s_y} \end{pmatrix} \begin{pmatrix} x \\ y \end{pmatrix} \] | ||
|
|||
\[ \underbrace{ \begin{pmatrix} \color{blue}{\class{sxval2}{1}} & 0 \\ 0 & \color{blue}{\class{syval2}{1}} \end{pmatrix}}_{\color{blue}{\large S}} \begin{pmatrix} x \\ y \end{pmatrix} \] |
|
Rotation by \(\theta\) counter-clockwise: \[ \begin{pmatrix} \color{blue}{\cos \theta} & -\sin \theta \\ \color{blue}{\sin \theta} & \cos \theta \end{pmatrix} \begin{pmatrix} x \\ y \end{pmatrix} \] | ||
\[ \underbrace{ \begin{pmatrix} \color{blue}{\cos \class{rotangle}{30}°} & -\sin \class{rotangle}{30} °\\ \color{blue}{\sin \class{rotangle}{30}°} & \cos \class{rotangle}{30} ° \end{pmatrix}}_{\color{blue}{\large R}} \begin{pmatrix} x \\ y \end{pmatrix} = \begin{pmatrix} \color{blue}{\class{cosangle}{0.87}} & \class{nsinangle}{-0.5}\\ \color{blue}{\class{sinangle}{0.5}} & \class{cosangle}{0.87} \end{pmatrix} \begin{pmatrix} x \\ y \end{pmatrix} \] |
\(t_x\)
\(t_y\)
|
Translate by \((t_x, t_y)\): \[ \begin{pmatrix} ? & ? \\ ? & ? \\ \end{pmatrix} \begin{pmatrix} 0 \\ 0 \end{pmatrix} = \begin{pmatrix} \color{blue}{t_x}\\ \color{blue}{t_y} \end{pmatrix} \] |
|
Translate by \((t_x, t_y)\): \[ \begin{pmatrix} 1 & 0 & \color{blue}{t_x} \\ 0 & 1 & \color{blue}{t_y} \\ 0 & 0 & 1 \end{pmatrix} \begin{pmatrix} x \\ y \\ 1 \end{pmatrix} \] | ||
|
|||
\[ \underbrace{ \begin{pmatrix} 1 & 0 & \color{blue}{\class{txval}{0}} \\ 0 & 1 & \color{blue}{\class{tyval}{0}} \\ 0 & 0 & 1 \end{pmatrix}}_{\color{blue}{\large T}} \begin{pmatrix} x \\ y \\ 1 \end{pmatrix} \] |
R |
Ty |
Sy |
|
Tx | |||
Sx |
|
What is the result of transforming this square by this sequence of matrices? \[\small \begin{pmatrix} 1 & 0 & 0\\ 0 & 1 & -2\\ 0 & 0 & 1 \end{pmatrix} \begin{pmatrix} 0 & -1 & 0\\ 1 & 0 & 0\\ 0 & 0 & 1 \end{pmatrix} \begin{pmatrix} 1 & 0 & 1\\ 0 & 1 & 0\\ 0 & 0 & 1 \end{pmatrix} \] |
1 | 2 | 3 | 4 |
|
What is the result of transforming this square by this sequence of matrices? \[\small \begin{pmatrix} 0 & 1 & 0\\ -1 & 0 & 0\\ 0 & 0 & 1 \end{pmatrix} \begin{pmatrix} 2 & 0 & 0\\ 0 & 2 & 0\\ 0 & 0 & 1 \end{pmatrix} \begin{pmatrix} 1 & 0 & 1\\ 0 & 1 & 1\\ 0 & 0 & 1 \end{pmatrix} \] |
1 | 2 | 3 | 4 |
R |
Ty |
|
Tx |
Sx |
Sy |
Sz |
Scale by \((s_x, s_y, s_z)\): \[ \begin{pmatrix} \color{blue}{s_x} & 0 & 0 \\ 0 & \color{blue}{s_y} & 0 \\ 0 & 0 & \color{blue}{s_z} \end{pmatrix} \begin{pmatrix} x \\ y \\ z \end{pmatrix} \] | ||
\[ \underbrace{ \begin{pmatrix} \color{blue}{\class{s3xval}{1}} & 0 & 0 & 0 \\ 0 & \color{blue}{\class{s3yval}{1}} & 0 & 0 \\ 0 & 0 & \color{blue}{\class{s3zval}{1}} & 0 \\ 0 & 0 & 0 & 1 \\ \end{pmatrix}}_{\color{blue}{\large S}} \begin{pmatrix} x \\ y \\ z \\ 1 \end{pmatrix} \] |
Rotate by \((\alpha, \beta, \gamma)\):
\[
R_x = \begin{pmatrix}
1 & 0 & 0 & 0\\
0 & cos(\color{blue}{\alpha}) & -sin(\color{blue}{\alpha}) & 0 \\
0 & sin(\color{blue}{\alpha}) & cos(\color{blue}{\alpha}) & 0\\
0 & 0 & 0 & 1
\end{pmatrix}
R_y = \begin{pmatrix}
cos(\color{blue}{\beta}) & 0 & sin(\color{blue}{\beta}) & 0 \\
0 & 1 & 0 & 0\\
-sin(\color{blue}{\beta}) & 0 & cos(\color{blue}{\beta}) & 0\\
0 & 0 & 0 & 1
\end{pmatrix}
R_z = \begin{pmatrix}
cos(\color{blue}{\gamma}) & -sin(\color{blue}{\gamma}) & 0 & 0 \\
sin(\color{blue}{\gamma}) & cos(\color{blue}{\gamma}) & 0 & 0 \\
0 & 0 & 1 & 0 \\
0 & 0 & 0 & 1 \\
\end{pmatrix}
\]
\[
R =
R_x*R_y*R_z
\]
Rodrigues' Rotation Formula:
\[
R(\theta, \omega) = \begin{pmatrix}
cos\theta + {\omega}_x^2(1 - cos\theta) & -\omega_z sin\theta + \omega_x\omega_y(1 - cos\theta) & \omega_y sin\theta + \omega_x\omega_z(1 - cos\theta) & 0\\
\omega_z sin\theta + \omega_x\omega_y(1 - cos\theta) & cos\theta + {\omega}_y^2(1 - cos\theta) & -\omega_x sin\theta + \omega_y\omega_z(1 - cos\theta) & 0 \\
-\omega_y sin\theta + \omega_x\omega_z(1 - cos\theta) & \omega_x sin\theta + \omega_y\omega_z(1 - cos\theta) & cos\theta + {\omega}_z^2(1 - cos\theta) & 0\\
0 & 0 & 0 & 1
\end{pmatrix}\]
|
Rotate by \((\alpha, \beta, \gamma)\) |
Rx |
Ry |
Rz |
|
\[ \underbrace{ \begin{pmatrix} 1 & 0 & 0 & 0\\ 0 & cos(\color{blue}{\class{alpha}{0.0}}) & -sin(\color{blue}{\class{alpha}{0.0}}) & 0 \\ 0 & sin(\color{blue}{\class{alpha}{0.0}}) & cos(\color{blue}{\class{alpha}{0.0}}) & 0\\ 0 & 0 & 0 & 1 \end{pmatrix}}_{\color{blue}{\large R_x}} \underbrace{ \begin{pmatrix} cos(\color{blue}{\class{beta}{0.0}}) & 0 & sin(\color{blue}{\class{beta}{0.0}}) & 0 \\ 0 & 1 & 0 & 0\\ -sin(\color{blue}{\class{beta}{0.0}}) & 0 & cos(\color{blue}{\class{beta}{0.0}}) & 0\\ 0 & 0 & 0 & 1 \end{pmatrix}}_{\color{blue}{\large R_y}} \underbrace{ \begin{pmatrix} cos(\color{blue}{\class{gamma}{0.0}}) & -sin(\color{blue}{\class{gamma}{0.0}}) & 0 & 0 \\ sin(\color{blue}{\class{gamma}{0.0}}) & cos(\color{blue}{\class{gamma}{0.0}}) & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \\ \end{pmatrix}}_{\color{blue}{\large R_z}} \begin{pmatrix} x\\ y\\ z\\ 1 \end{pmatrix} \] |
Tx |
Ty |
Tz |
Translate by \((t_x, t_y, t_z)\): \[ \begin{pmatrix} 1 & 0 & 0 & \color{blue}{t_x}\\ 0 & 1 & 0 & \color{blue}{t_y}\\ 0 & 0 & 1 & \color{blue}{t_z}\\ 0 & 0 & 0 & 1 \end{pmatrix} \begin{pmatrix} x\\ y\\ z\\ 1 \end{pmatrix} \] | ||
\[ \underbrace{ \begin{pmatrix} 1 & 0 & 0 & \color{blue}{\class{t3xval}{1}} \\ 0 & 1 & 0 & \color{blue}{\class{t3yval}{1}} \\ 0 & 0 & 1 & \color{blue}{\class{t3zval}{1}} \\ 0 & 0 & 0 & 1 \end{pmatrix}}_{\color{blue}{\large T}} \begin{pmatrix} x \\ y \\ z \\ 1 \end{pmatrix} \] |
|
||||||||||||
\[ \underbrace{ \begin{pmatrix} 1 & 0 & 0 & \color{blue}{\class{ft3xval}{0}} \\ 0 & 1 & 0 & \color{blue}{\class{ft3yval}{0}} \\ 0 & 0 & 1 & \color{blue}{\class{ft3zval}{0}} \\ 0 & 0 & 0 & 1 \end{pmatrix}}_{\color{blue}{\large T}} \underbrace{ \begin{pmatrix} 1 & 0 & 0 & 0\\ 0 & cos(\color{blue}{\class{falpha}{0.0}}) & -sin(\color{blue}{\class{falpha}{0.0}}) & 0 \\ 0 & sin(\color{blue}{\class{falpha}{0.0}}) & cos(\color{blue}{\class{falpha}{0.0}}) & 0\\ 0 & 0 & 0 & 1 \end{pmatrix} \begin{pmatrix} cos(\color{blue}{\class{fbeta}{0.0}}) & 0 & sin(\color{blue}{\class{fbeta}{0.0}}) & 0 \\ 0 & 1 & 0 & 0\\ -sin(\color{blue}{\class{fbeta}{0.0}}) & 0 & cos(\color{blue}{\class{fbeta}{0.0}}) & 0\\ 0 & 0 & 0 & 1 \end{pmatrix} \begin{pmatrix} cos(\color{blue}{\class{fgamma}{0.0}}) & -sin(\color{blue}{\class{fgamma}{0.0}}) & 0 & 0 \\ -sin(\color{blue}{\class{fgamma}{0.0}}) & cos(\color{blue}{\class{fgamma}{0.0}}) & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \\ \end{pmatrix}}_{\color{blue}{\large R}} \underbrace{ \begin{pmatrix} \color{blue}{\class{fs3xval}{1}} & 0 & 0 & 0 \\ 0 & \color{blue}{\class{fs3yval}{1}} & 0 & 0 \\ 0 & 0 & \color{blue}{\class{fs3zval}{1}} & 0 \\ 0 & 0 & 0 & 1 \\ \end{pmatrix}}_{\color{blue}{\large S}} \begin{pmatrix} x \\ y \\ z \\ 1 \end{pmatrix} \] |
|
||||||||||||
\[ \underbrace{ \begin{pmatrix} cos(\color{blue}{\class{fgamma2}{0.0}}) & -sin(\color{blue}{\class{fgamma2}{0.0}}) & 0 & 0 \\ -sin(\color{blue}{\class{fgamma2}{0.0}}) & cos(\color{blue}{\class{fgamma2}{0.0}}) & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \\ \end{pmatrix} \begin{pmatrix} cos(\color{blue}{\class{fbeta2}{0.0}}) & 0 & sin(\color{blue}{\class{fbeta2}{0.0}}) & 0 \\ 0 & 1 & 0 & 0\\ -sin(\color{blue}{\class{fbeta2}{0.0}}) & 0 & cos(\color{blue}{\class{fbeta2}{0.0}}) & 0\\ 0 & 0 & 0 & 1 \end{pmatrix} \begin{pmatrix} 1 & 0 & 0 & 0\\ 0 & cos(\color{blue}{\class{falpha2}{0.0}}) & -sin(\color{blue}{\class{falpha2}{0.0}}) & 0 \\ 0 & sin(\color{blue}{\class{falpha2}{0.0}}) & cos(\color{blue}{\class{falpha2}{0.0}}) & 0\\ 0 & 0 & 0 & 1 \end{pmatrix} }_{\color{blue}{\large R}} \underbrace{ \begin{pmatrix} \color{blue}{\class{fs3xval2}{1}} & 0 & 0 & 0 \\ 0 & \color{blue}{\class{fs3yval2}{1}} & 0 & 0 \\ 0 & 0 & \color{blue}{\class{fs3zval2}{1}} & 0 \\ 0 & 0 & 0 & 1 \\ \end{pmatrix}}_{\color{blue}{\large S}} \underbrace{ \begin{pmatrix} 1 & 0 & 0 & \color{blue}{\class{ft3xval2}{0}} \\ 0 & 1 & 0 & \color{blue}{\class{ft3yval2}{0}} \\ 0 & 0 & 1 & \color{blue}{\class{ft3zval2}{0}} \\ 0 & 0 & 0 & 1 \end{pmatrix}}_{\color{blue}{\large T}} \begin{pmatrix} x \\ y \\ z \\ 1 \end{pmatrix} \] |