"

Section 1 — Vectors, Vector Operations, Vector Functions

Topic 1.3 — The Dot Product

Angles, orthogonality, and projections.

GRAPHS & CODE

Graphs

To reset a graph, refresh its browser window.

  • Graph 1 — Three vectors in the \(xy\)-plane.
  • Graph 2 — Vector projection in the \(xy\)-plane.
  • Graph 3 — Another vector projection in the \(xy\)-plane.

Code — Projections and scalar components.

Use this code to compute the projection of a vector \(\vec{v}\) onto a second (non-zero) vector \(\vec{u}\):

\[\text{proj}_{\vec{u}} \, \vec{v} = \left( \frac{ \vec{v} \cdot \vec{u}}{ |\vec{u} |^2} \right) \vec{u}\]

and the projection’s scalar component:

\[\text{comp}_{\vec{u}} \, \vec{v} = \frac{ \vec{v} \cdot \vec{u} }{ |\vec{u} |}\]


EXERCISE 1 — Angles & Orthogonality

Background & Notes

If \(\vec{a}\) and \(\vec{b}\) are two vectors with the same number of components, the dot product \(\vec{a} \cdot \vec{b}\) is defined algebraically as:

\[\vec{a} \cdot \vec{b} = a_1 b_1 + a_2 b_2 + \cdots + a_n b_n\]

If both vectors are non-zero, and \(\theta\) is the angle between them, the dot product can be defined geometrically as:

\[\vec{a} \cdot \vec{b} = |\vec{a}| |\vec{b}| \cos \theta\]

Two vectors \(\vec{a}\) and \(\vec{b}\) are orthogonal if their dot product equals zero:

\[\vec{a} \cdot \vec{b} = 0\]

Assumptions

Let \(\vec{u}\), \(\vec{v}_1\), and \(\vec{v}_2\) be the vectors:

\[\begin{align*}
\vec{u} &= \big< 3, 2, 0 \big>\\
\vec{v}_1 &= \big< -4, 6, 0 \big>\\
\vec{v}_2 &= \big< 2, -1, 0 \big>
\end{align*}\]

Instructions

1. Compute (example)

Use the dot product to show that the pair of vectors \(\vec{u}\) and \(\vec{v}_1\) are orthogonal, but the pair \(\vec{u}\) and \(\vec{v}_2\) are not.

2. Find Examples (example)

  • Find a second vector \(\vec{v}_3\) in the \(xy\)-plane that is orthogonal to \(\vec{u}\).
  • Find a vector \(\vec{v}_4\) in the \(xy\)-plane that is not orthogonal to \(\vec{u}\).
  • Find a vector \(\vec{v}_5\) in 3-space (and not in the \(xy\)-plane) that is orthogonal to \(\vec{u}\).

3. Graph & Compare

Go to graph 1 and identify the vectors:

  • \(\vec{u} = \big< 3, 2, 0 \big>\) (red)
  • \(\vec{v}_1 = \big< -4, 6, 0 \big>\) (green)
  • \(\vec{v}_2 = \big< 2, -1, 0 \big>\) (blue)

Add your three additional examples to the graph, using the “Add to graph: Select…” drop-down menu to add three more vectors, and replacing their components with your three examples. Change the colors of the vectors using the color box.

Compare the angles between \(\vec{u}\) and the other vectors. Use the square button labeled 2D at the top right of the control window to switch between 2- and 3-dimensional views.

What do the angles between orthogonal pairs of vectors have in common?

4. Compute & Verify

Solve geometric definition of the dot product:

\[\vec{a} \cdot \vec{b} = |\vec{a}| |\vec{b}| \cos \theta\]

for the angle \(\theta\).

This is the angle between the vectors \(\vec{a}\) and \(\vec{b}\).

Use this equation to compute the angle between \(\vec{u}\) and \(\vec{v}_1\) – which are orthogonal — to verify that it is \(90^{\circ}\).

Then, compute the angle between \(\vec{u}\) and \(\vec{v}_2\) – which are not orthogonal — and verify it is not \(90^{\circ}\).

5. Formalize

Use the algebraic definition to show the zero vector \(\vec{0} = \big< 0, 0, 0 \big>\) is orthogonal to every other vector.

Then, use the geometric definition to show that pairs of non-zero vectors are orthogonal if and only if they are perpendicular.

Question: Why does the zero vector require a separate case?


EXERCISE 2 — Projections & Scalar Components

Background & Notes

A projection of a vector \(\vec{a}\) onto a second (non-zero) vector \(\vec{b}\) is the “shadow” cast by \(\vec{a}\) onto the line spanned by \(\vec{b}\), by a light source perpendicular to \(\vec{b}\).

The scalar component of the projection of \(\vec{a}\) onto \(\vec{b}\) is a scalar value that encodes both the magnitude of the projection, and the relative directions of the projection and \(\vec{b}\).

The equations used to compute the projection of \(\vec{a}\) onto \(\vec{b}\), and the projection’s scalar component, are:

\[\begin{align*}
\text{proj}_{\vec{b}} \, \vec{a} &= \left( \frac{\vec{a} \cdot \vec{b}}{|\vec{b}|^2} \right) \, \vec{b}\\
\text{comp}_{\vec{b}} \, \vec{a} &= \frac{\vec{a} \cdot \vec{b}}{|\vec{b}|}
\end{align*}\]

Assumptions

Let \(\vec{u}\), \(\vec{v}\), and \(\vec{w}\) be the vectors:

\[\begin{align*}
\vec{u} &= \big< 3, -1 \big>\\
\vec{v} &= \big< 6, 2 \big>\\
\vec{w} &= \big< -2, 6 \big>
\end{align*}\]

Instructions

1. Compute (example)

Copy this table into your notebook:

Angles between vectors, scalar components, and direction of projections.
vector pair angle \(\theta\) between the vectors — acute / obtuse scalar component of the projection relative directions of the projection and \(\vec{u}\) — same / opposite
\(\vec{v}\), \(\vec{u}\) \(\text{comp}_{\vec{u}} \, \vec{v} = \hspace{1cm}\)
\(\vec{w}\), \(\vec{u}\) \(\text{comp}_{\vec{u}} \, \vec{w} = \hspace{1cm}\)

Edit and run this code to compute the projection of \(\vec{v}\) onto \(\vec{u}\):

\[\text{proj}_{\vec{u}} \, \vec{v} = \left( \frac{ \vec{v} \cdot \vec{u} }{ |\vec{u} |^2} \right) \, \vec{u}\]

And the projection’s scalar component:

\[\text{comp}_{\vec{u}} \, \vec{v} = \frac{ \vec{v} \cdot \vec{u} }{ |\vec{u} |}\]

  • Replace the components of u = sp.Matrix([a,b,c]) in the code with the components of \(\vec{u} = \big< 3, -1, 0 \big>\).
  • Replace the components of v = sp.Matrix([d,e,f]) in the code with the components of \(\vec{v} = \big< 6, 2, 0 \big>\).
  • Run the code, and add the value of the scalar component \(\text{comp}_{\vec{u}} \, \vec{v}\) to the first row of your table.

2. Graph & Observe (example)

Go to graph 2 and identify the three vectors:

  • \(\vec{u} = \big< 3, -1 \big>\) (red)
  • \(\vec{v} = \big< 6, 2 \big>\) (blue)
  • \(\text{proj}_{\vec{u}} \, \vec{v} = \left< \frac{24}{5},-\frac{8}{5} \right>\) (green)

Graphically, the projection \(\text{proj}_{\vec{u}} \, \vec{v}\) (green) is the “shadow” of \(\vec{v}\) (blue) on the line spanned by \(\vec{u}\) (red).

Complete the first row of your table, based on your observations about:

  • The angle \(\theta\) between \(\vec{v}\) and \(\vec{u}\).
  • The relative directions of the projection \(\text{proj}_{\vec{u}} \, \vec{v}\) and the vector \(\vec{u}\).

3. Compute

Edit and run this code to compute the projection of \(\vec{w}\) onto \(\vec{u}\)

\[\text{proj}_{\vec{u}} \, \vec{w} = \left( \frac{ \vec{w} \cdot \vec{u} }{ |\vec{u} |^2} \right) \vec{u}\]

And the projection’s scalar component:

\[\text{comp}_{\vec{u}} \, \vec{w} = \frac{\vec{w} \cdot \vec{u} }{ |\vec{u}|}\]

  • Replace the components of u in the code with the components of \(\vec{u} = \big< 3, -1, 0 \big>\).
  • Replace the components of v in the code with the components of \(\vec{w} = \big< -2, 6, 0 \big>\).
  • Run the code, and add the value of the scalar component \(\text{comp}_{\vec{u}} \, \vec{w}\) to the first row of your table.

4. Graph & Observe

Go to graph 3.

On the graph, identify the vectors \(\vec{u}\) (red) and \(\vec{w}\) (blue).

At the top of the command window, locate the vector < 0, 0 > (green), and replace its components with those of the projection \(\text{proj}_{\vec{v}} \, \vec{w}\) generated by the code.

Graphically, the projection \(\text{proj}_{\vec{u}} \, \vec{w}\) (green) is the “shadow” of \(\vec{w}\) (blue) on the line spanned by \(\vec{u}\) (red).

Complete the second row of your table, based on your observations of:

  • The angle \(\theta\) between \(\vec{w}\) and \(\vec{u}\).
  • The relative directions of the projection \(\text{proj}_{\vec{u}} \, \vec{w}\) and the vector \(\vec{u}\).

5. Compare & Analyze

Analyze the results on your table. What conclusions can you reach about the relationships between:

  • ANGLES — The angle between a pair of non-zero vectors \(\vec{a}\) and \(\vec{b}\).
  • SIGNS — The sign of the scalar component \(\text{comp}_{\vec{b}} \, \vec{a}\).
  • DIRECTIONS — The relative directions of the projection \(\text{proj}_{\vec{b}} \, \vec{a}\) and the vector \(\vec{b}\).

BIG IDEAS

Angles & Orthogonality (exercise 1)

Two vectors \(\vec{a}\) and \(\vec{b}\) are orthogonal when their dot product equals zero:

\[\vec{a} \cdot \vec{b} = 0\]

\(\vec{a}\) and \(\vec{b}\) are orthogonal exactly when one of the following conditions hold:

\[\vec{a} = \vec{0} \quad \text{or} \quad\vec{b} = \vec{0}\]

or:

\[\vec{a} \perp \vec{b}\]

The equation for computing the angle \(\theta\) between two non-zero vectors \(\vec{a}\) and \(\vec{b}\) is derived from the geometric definition of the dot product:

\[\theta = \arccos\left( \frac{\vec{a}\cdot\vec{b}}{|\vec{a}||\vec{b}|}\right)\]

Projections & Scalar Components (exercise 2)

Suppose \(\vec{a}\) and \(\vec{b}\) are non-zero vectors, and \(\theta\) is the angle between them.

(We only consider angles between \(0\) and \(180^{\circ}\).)

If the angle is acute \((0^{\circ} \leq \theta < 90^{\circ})\):

  • The scalar component \(\text{comp}_{\vec{b}} \, \vec{a}\) is positive.
  • The projection \(\text{proj}_{\vec{b}} \, \vec{a}\) and \(\vec{b}\) have the same direction.

If the angle is obtuse \((90^{\circ} < \theta \leq 180^{\circ})\):

  • The scalar component \(\text{comp}_{\vec{b}} \, \vec{a}\) is negative.
  • The projection \(\text{proj}_{\vec{b}} \, \vec{a}\) and \(\vec{b}\) have opposite directions.

If \(\vec{a}\) and \(\vec{b}\) are orthogonal \((\theta = 90^{\circ})\):

  • The scalar component \(\text{comp}_{\vec{b}} \, \vec{a} = 0\).
  • The projection \(\text{proj}_{\vec{b}} \, \vec{a} = \vec{0}\).

License

Share This Book