LECTURE 05

Angles and Projections

The dot product: measuring alignment between directions.

The Hook

You have two bond vectors in a molecule. You can compute their lengths (Lecture 4).

But now you want to know: What is the angle between them?

Or: How much does one vector point in the direction of another?

These questions require a new operation: the dot product.

Two Bond Vectors in Water

O-H1 vector b1 = (0.958, 0, 0)
O-H2 vector b2 = (-0.240, 0.927, 0)
Angle 104.5 deg

Recognition

DIRECTION (continued)

"It points."

The dot product answers questions about relative direction:

When to Use the Dot Product

QuestionDot product gives you
"What's the angle between these two directions?"theta = arccos(v.w / |v||w|)
"Are these perpendicular?"Yes if v.w = 0
"Are these parallel?"Yes if v.w = +/-|v||w|
"How much of v points along w?"Projection: (v.w)/|w|
"What's the work done by a force?"W = F.d

Key insight: The dot product measures alignment between vectors.

The Dot Product: Two Definitions

Definition 1 (Geometric)

Definition

For vectors v and w, the dot product is:

$$\mathbf{v} \cdot \mathbf{w} = |\mathbf{v}||\mathbf{w}|\cos\theta$$

where theta is the angle between the vectors.

Definition 2 (Algebraic)

Definition

For vectors v = (v1, v2, ..., vn) and w = (w1, w2, ..., wn):

$$\mathbf{v} \cdot \mathbf{w} = v_1 w_1 + v_2 w_2 + \cdots + v_n w_n = \sum_{i=1}^{n} v_i w_i$$
Example

v = (3, -1, 2), w = (1, 4, -1)

v.w = (3)(1) + (-1)(4) + (2)(-1) = 3 - 4 - 2 = -3

The negative value tells us the vectors point "mostly away" from each other.

Theorem

The geometric and algebraic definitions are equivalent.

Properties of the Dot Product

1. Commutative
v.w = w.v
2. Distributive
u.(v + w) = u.v + u.w
3. Scalar multiplication
(cv).w = c(v.w)
4. Self dot product
v.v = |v|^2

Property 4 is particularly useful: |v| = sqrt(v.v)

Computing Angles

The Angle Formula
$$\theta = \arccos\left(\frac{\mathbf{v} \cdot \mathbf{w}}{|\mathbf{v}||\mathbf{w}|}\right)$$
Example: Water bond angle

O-H1: b1 = (0.958, 0, 0), O-H2: b2 = (-0.240, 0.927, 0)

b1.b2 = -0.230, |b1| = |b2| = 0.958

cos theta = -0.230 / 0.918 = -0.251

theta = arccos(-0.251) = 104.5 deg

Example: Tetrahedral angle (Methane)

b1 = (1, 1, 1)/sqrt(3), b2 = (1, -1, -1)/sqrt(3)

b1.b2 = -1/3, theta = arccos(-1/3) = 109.47 deg

Orthogonality

Definition

Vectors v and w are orthogonal (perpendicular) if v.w = 0.

Orthogonality Tester

v.w 0.00
Angle 90.0 deg
Relationship Perpendicular

Projection

The projection problem: Find the component of v in the direction of w.

Scalar Projection

Definition
$$\text{comp}_{\mathbf{w}} \mathbf{v} = \frac{\mathbf{v} \cdot \mathbf{w}}{|\mathbf{w}|} = |\mathbf{v}|\cos\theta$$

Vector Projection

Definition
$$\text{proj}_{\mathbf{w}} \mathbf{v} = \frac{\mathbf{v} \cdot \mathbf{w}}{\mathbf{w} \cdot \mathbf{w}} \mathbf{w}$$

Projection Visualizer

v (106, 106)
proj_w v (106, 0)
v_perp (0, 106)

Orthogonal Decomposition

$$\mathbf{v} = \text{proj}_{\mathbf{w}} \mathbf{v} + \mathbf{v}_\perp$$

Chemistry Connection: Bond Angles

Bond Angle Algorithm
  1. Compute bond vectors: b1 = r_A - r_B, b2 = r_C - r_B
  2. Compute dot product: b1.b2
  3. Compute magnitudes: |b1|, |b2|
  4. Apply: theta = arccos(b1.b2 / |b1||b2|)

Bond Angle Calculator

Bond 1 b1 = (0.96, 0.00, 0.00)
Bond 2 b2 = (-0.24, 0.93, 0.00)
b1.b2 -0.230
Angle 104.5 deg

Chemistry Connection: Work and Energy

Work as Dot Product
$$W = \mathbf{F} \cdot \mathbf{d} = |\mathbf{F}||\mathbf{d}|\cos\theta$$

Dipole-Field Interaction

$$U = -\boldsymbol{\mu} \cdot \mathbf{E}$$

Minimum energy when dipole aligned with field (theta = 0).

Summary

The Dot Product Toolkit

I want to...Formula
Find angle between vectorstheta = arccos(v.w / |v||w|)
Check if perpendicularTest if v.w = 0
Find length of vector|v| = sqrt(v.v)
Project v onto wproj_w v = (v.w / w.w) w
Compute workW = F.d

Exercises

Exercise 1: Basic Dot Products

Compute v.w: (a) v=(2,3), w=(4,-1) (b) v=(1,0,0), w=(0,1,0) (c) v=(1,1,1), w=(1,1,1)

Solution

(a) 8-3 = 5 (b) 0 (perpendicular) (c) 3

Exercise 2: Angles

Find the angle between: (a) v=(1,0), w=(1,1) (b) v=(3,4), w=(-4,3)

Solution

(a) cos theta = 1/sqrt(2), theta = 45 deg (b) v.w = 0, theta = 90 deg

Exercise 3: Projection

Project v = (4, 3) onto w = (1, 1). Find the perpendicular component.

Solution

v.w = 7, w.w = 2, proj = (7/2)(1,1) = (3.5, 3.5)

v_perp = (4,3) - (3.5,3.5) = (0.5, -0.5)

Exercise 4: Work

Force F = (10, -5, 2) N acts as particle moves from (1,2,3) to (4,1,5) m. Find the work.

Solution

d = (3, -1, 2), W = F.d = 30 + 5 + 4 = 39 J