up to Schedule & Notes

Calculating the dot and cross products

  1. Calculate $(1, 2, 3) \cdot (4, 5, 6)$. solution
    $1 \times 4 + 2 \times 5 + 3 \times 6 = 32$
  2. Calculate the magnitude of the projection of $(1, 2, 3)$ onto the line of $(4, 5, 6)$. solution
    $(1,2,3) \cdot {(4,5,6) \over |(4,5,6)|} = {32 \over \sqrt{77}}$
  3. Calculate $(1, 0, 2) \cdot (4, 10, -2)$. What is the significance of the result? solution
    $(1, 0, 2) \cdot (4, 10, -2) = 0$. This means that the vectors are perpendicular.
  4. Calculate the squared magnitude of the vector $(1, 2, 2)$ using the dot product. solution
    $(1,2,2) \cdot (1,2,2) = 9$.
  5. Calculate $(0,1,2) \times (3,4,5)$, where $\times$ is the cross product. solution
    $(0,1,2) \times (3,4,5) = \left[ \begin{array}{c} 1 {\small \times} 5 - 2 {\small \times} 4 \\ 2 {\small \times} 3 - 0 {\small \times} 5 \\ 0 {\small \times} 4 - 1 {\small \times} 3 \\ \end{array} \right] = \begin{bmatrix} -3 \\ 6 \\ -3 \end{bmatrix}$

Geometric interpretation of the dot and cross products

  1. When is $u \cdot v$ not equal to the length of the projection of $u$ onto the line of $v$? solution
    When $v$ is not unit length.
  2. When is $u \cdot v$ negative? solution
    When the projection of $u$ onto the line of $v$ is in the opposite direction to $v$. Equivalently: When the angle between $u$ and $v$ is in $[{\pi \over 2},{3 \pi \over 2}]$.
  3. For 3D vectors $u$ and $v$: $|u| = |v| = 1$ and $u \cdot v = 0$. Then what is special about the vector $w = u \times v$? solution
    $w$ is unit length ($|w| = |u| \; |v| \; \sin {\pi \over 2}$) and is perpendicular to both $u$ and $v$. So $\langle u, v, w \rangle$ forms an orthogonal basis.

Using the dot and cross products

  1. Using your knowledge of the dot product, quickly find a non-zero vector perpendicular to $(1,2,3,4,5)$. solution
    Find a vector such that its dot product with $(1,2,3,4,5)$ is zero. This can be done by swapping two of the coordinates, negating one of those, and setting the rest to zero. For example: $(2,-1,0,0,0)$.
  2. What are the coordinates of $(1,2,3)$ in the $\langle (1,0,0), (0,1,0), (0,0,1) \rangle$ coordinate system? solution
    $(1,2,3)$
  3. What are the coordinates of $(1,2,3)$ in the $\langle ({1 \over \sqrt{2}},0,{-1 \over \sqrt{2}}), (0,1,0), ({1 \over \sqrt{2}},0,{1 \over \sqrt{2}}) \rangle$ coordinate system? solution
    Project onto each axis: $({-2 \over \sqrt{2}}, \; 2, \; {4 \over \sqrt{2}} ) = (-\sqrt{2}, \; 2, \; 2 \sqrt{2} )$.
  4. Using your two answers above, what effect does the matrix transformation
    $\begin{bmatrix} {1 \over \sqrt{2}} & 0 & {-1 \over \sqrt{2}} \\ 0 & 1 & 0 \\ {1 \over \sqrt{2}} & 0 & {1 \over \sqrt{2}} \end{bmatrix}$
    have on the vector $(1,2,3)$? solution

    Rotates the vector by $-45^o$ about the $(0,1,0)$ axis.

    In 2D, the rotation by $45^o$ is done with the matrix $$\displaystyle \left[\begin{array}{cc} \cos 45 & -\sin 45 \\ \sin 45 & \cos 45 \end{array}\right] = \left[\begin{array}{cc} {1 \over \sqrt{2}} & -{1 \over \sqrt{2}} \\ {1 \over \sqrt{2}} & {1 \over \sqrt{2}} \end{array}\right]$$

    Implicitly, this rotation is being done in a 2D $x y$ plane that sits in a 3D space, with the $z$ axis pointing perpendicularly out of the $x y$ plane.

    So this is a rotation by $45^o$ around the $z$ axis.  If we were using 3D coordinates, it would be written as $$\left[\begin{array}{ccc} {1 \over \sqrt{2}} & -{1 \over \sqrt{2}} & 0\\ {1 \over \sqrt{2}} & {1 \over \sqrt{2}} & 0 \\ 0 & 0 & 1 \end{array}\right]$$

    since that matrix does not change the $z$ coordinate.

    To do the same rotation in the $x z$ plane, instead, we need to rotate around the $y$ axis. Swapping the roles of $y$ and $z$ in the matrix above yields $$\left[\begin{array}{ccc} {1 \over \sqrt{2}} & 0 & -{1 \over \sqrt{2}} \\ 0 & 1 & 0 \\ {1 \over \sqrt{2}} & 0 & {1 \over \sqrt{2}}  \end{array}\right]$$

  5. Show, using the dot product, that $\langle (0,1,0), ({1 \over \sqrt{2}},0,{-1 \over \sqrt{2}}), ({1 \over \sqrt{2}},0,{1 \over \sqrt{2}}) \rangle$ in an orthogonal coordinate system. solution

    All vectors are mutually perpendicular:

    $(0,1,0) \cdot ({1 \over \sqrt{2}},0,{-1 \over \sqrt{2}}) = 0$

    $(0,1,0) \cdot ({1 \over \sqrt{2}},0,{1 \over \sqrt{2}}) = 0$

    $({1 \over \sqrt{2}},0,{-1 \over \sqrt{2}}) \cdot ({1 \over \sqrt{2}},0,{1 \over \sqrt{2}}) = 0$

    All vectors are unit length:

    $(0,1,0) \cdot (0,1,0) = 1$

    $({1 \over \sqrt{2}},0,{1 \over \sqrt{2}}) \cdot ({1 \over \sqrt{2}},0,{1 \over \sqrt{2}}) = 1$

    $({1 \over \sqrt{2}},0,{-1 \over \sqrt{2}}) \cdot ({1 \over \sqrt{2}},0,{-1 \over \sqrt{2}}) = 1$

  6. Use the dot product to break $(1,0,2)$ into two components: one that is parallel to $(0,2,1)$ and one that is perpendicular to $(0,2,1)$. solution

    First, find the parallel vector that is the projection of $(1,0,2)$ to $(0,2,1)$:

    $u = \left( { (1,0,2) \; \cdot \; (0,2,1) \over (0,2,1) \; \cdot \; (0,2,1) } \right) \; (0,2,1) = ( 0, { 4 \over 5}, {2 \over 5} )$.

    Second, get the perpendicular vector by subtracting that parallel vector from $(1,0,2)$:

    $v = (1,0,2) - ( 0, { 4 \over 5}, {2 \over 5} ) = (1, { -4 \over 5}, {8 \over 5})$.

    Then $(1,0,2) = u + v = ( 0, { 4 \over 5}, {2 \over 5} ) + (1, { -4 \over 5}, {8 \over 5})$.

    Note that u and v are perpendicular: $u \cdot v = ( 0, { 4 \over 5}, {2 \over 5} ) \; \cdot \; (1, { -4 \over 5}, {8 \over 5}) = 0$.

  7. A triangle has vertices $(0,1,1)$, $(1,1,1)$, and $(-2,2,-1)$. Calculate a "normal vector" that is perpendicular to the triangle and has unit length. How many normal vectors exist that have these two properties? Explain. solution

    First, find vectors $u$ and $v$ along the triangle edges:

    $u = (1,1,1) - (0,1,1) = (1,0,0)$

    $v = (-2,2,-1) - (0,1,1) = (-2,1,-2)$

    Second, take their cross product:

    $u \times v = (1,0,0) \times (-2,1,-2) = \left[ \begin{array}{c} (0 {\small \times} -2) - (0 {\small \times} 1) \\ (0 {\small \times} -2) - (1 {\small \times} -2) \\ (1 {\small \times} 1) - (0 {\small \times} -2) \\ \end{array} \right] = \begin{bmatrix} 0 \\ 2 \\ 1 \end{bmatrix}$

    Third, normalize the cross product:

    $n = {u \times v \over |u \times v|} = { (0,2,1) \over |(0,2,1)| } = (0,{2 \over \sqrt{5}}, {1 \over \sqrt{5}})$

    There are two such normal vectors: $n$ and $-n$.

up to Schedule & Notes