Chapter 15
18 min read
Section 135 of 353

Vectors in 2D and 3D

Vectors and the Geometry of Space

Learning Objectives

By the end of this section, you will be able to:

  1. Define vectors as objects with both magnitude and direction
  2. Represent vectors using component form in 2D and 3D coordinate systems
  3. Compute vector magnitude (length) using the Pythagorean theorem
  4. Perform vector addition, subtraction, and scalar multiplication
  5. Find unit vectors and understand their significance
  6. Express vectors using standard basis vectors i\mathbf{i}, j\mathbf{j}, k\mathbf{k}
  7. Apply vectors to physics, engineering, and machine learning problems

The Big Picture: Why Vectors Matter

"Vectors are the language of physics and the foundation of multivariable calculus." — Richard Feynman

Imagine giving directions to a friend. Saying "walk 100 meters" isn't enough — they need to know which direction. "Walk 100 meters north" provides the complete picture. This combination of magnitude (100 meters) and direction (north) is exactly what vectors capture.

Vectors are everywhere in the physical world. When you throw a ball, it has a velocity — not just a speed, but a speed in a particular direction. Forces, accelerations, electric fields, gravitational pulls — all are vector quantities that combine magnitude with direction.

Scalars vs. Vectors

Scalars are quantities with only magnitude: temperature (25°C), mass (5 kg), time (3 seconds). A single number describes them completely.

Vectors are quantities with both magnitude and direction: velocity (50 m/s north), force (10 N upward), displacement (3 km east). A single number is insufficient — we need direction too.

Where Vectors Appear

Physics

  • Velocity and acceleration
  • Forces (gravity, friction, tension)
  • Electric and magnetic fields
  • Momentum and angular momentum

Engineering

  • Structural analysis (stress vectors)
  • Fluid flow (velocity fields)
  • Signal processing
  • Robotics (position and orientation)

Computer Graphics

  • 3D modeling and animation
  • Light and surface normals
  • Camera positioning
  • Collision detection

Machine Learning

  • Feature vectors
  • Word embeddings
  • Gradient vectors
  • Weight vectors

Historical Origins: From Arrows to Algebra

The concept of vectors evolved over centuries, with contributions from mathematicians and physicists working on seemingly different problems.

Early Developments

The idea of combining magnitude and direction appears in ancient mechanics, but the formal mathematical treatment began in the 19th century. Sir William Rowan Hamilton (1805–1865) developed quaternions in 1843, a precursor to modern vector algebra.

Hermann Grassmann (1809–1877) independently created a comprehensive theory of what he called "extension theory" — essentially vector spaces — in 1844, though his work was largely ignored during his lifetime.

The Modern Vector Concept

The modern notation and approach came from Josiah Willard Gibbs (1839–1903) at Yale and Oliver Heaviside (1850–1925) in England. Working independently in the 1880s, both extracted the useful parts of Hamilton's quaternions to create the vector analysis we use today.

Why Vectors Prevailed

Quaternions (4D number systems) were the dominant mathematical tool for physics before vectors. Gibbs and Heaviside showed that for most physical applications, 3D vectors are simpler and more intuitive. Today, quaternions are still used in computer graphics for rotations, but vectors dominate most applications.


What is a Vector?

Definition: Vector

A vector is a mathematical object that has both magnitude (size or length) and direction.

Geometrically, vectors are represented as directed line segments (arrows). The arrow's length represents magnitude; the arrow's orientation represents direction.

Key Terminology

TermDefinition
MagnitudeThe length of the vector, always non-negative
DirectionThe orientation in space (angle or heading)
Initial pointWhere the arrow starts (often the origin)
Terminal pointWhere the arrow ends (the tip)
Position vectorA vector from the origin to a point P
Free vectorA vector that can be moved freely (only magnitude and direction matter)

Two vectors are considered equal if and only if they have the same magnitude and the same direction. Their position in space doesn't matter — only their length and orientation.


Vector Notation

Vectors are denoted in several ways, depending on context:

NotationUsageExample
BoldfacePrinted textv, a, F
Arrow aboveHandwrittenv⃗, a⃗, F⃗
UnderlineSome textbooks
Component formCalculations(3, 4) or ⟨3, 4⟩
Basis formPhysics/engineering3i + 4j

The zero vector, denoted 0\mathbf{0} or 0\vec{0}, has magnitude 0. It's the only vector with no defined direction.


Vectors in 2D: The Cartesian Plane

In two dimensions, we describe vectors using components along the x-axis and y-axis.

Component Form in 2D

A vector v\mathbf{v} in 2D can be written as:

v=vx,vy=(vx,vy)\mathbf{v} = \langle v_x, v_y \rangle = (v_x, v_y)

where vxv_x is the horizontal component and vyv_y is the vertical component.

Position Vectors

If we have a point P=(a,b)P = (a, b) in the plane, the position vector from the origin OO to PP is:

OP=a,b\overrightarrow{OP} = \langle a, b \rangle

Vector Between Two Points

For points A=(a1,a2)A = (a_1, a_2) and B=(b1,b2)B = (b_1, b_2), the vector from AA to BB is:

AB=b1a1,b2a2=BA\overrightarrow{AB} = \langle b_1 - a_1, b_2 - a_2 \rangle = B - A

This is found by "terminal point minus initial point" — subtract coordinates component-wise.

Interactive 2D Vector Visualization

Explore vectors in 2D. Adjust the components of each vector and observe how addition, subtraction, and scalar multiplication work. Notice how the resultant vector (sum) follows the parallelogram law.

Vector Controls

Vector a
x = 3.0
y = 2.0
|a| = 3.61, θ = 33.7°
Vector b
x = 1.0
y = 4.0
|b| = 4.12, θ = 76.0°
Scalar k = 1.0

Applied to vector a


Vectors in 3D: Three-Dimensional Space

In three dimensions, we add a third component along the z-axis, giving vectors the ability to point anywhere in space.

Component Form in 3D

A vector v\mathbf{v} in 3D can be written as:

v=vx,vy,vz=(vx,vy,vz)\mathbf{v} = \langle v_x, v_y, v_z \rangle = (v_x, v_y, v_z)

All the operations that work in 2D extend naturally to 3D.

Right-Hand Coordinate System

We use the right-hand coordinate system: if you point your right hand's fingers along the positive x-axis and curl them toward the positive y-axis, your thumb points in the positive z-direction.

Interactive 3D Vector Visualization

Explore vectors in 3D space. Click and drag to rotate the view. Adjust the x, y, and z components of each vector and observe how they combine. Toggle the sum to see vector addition in three dimensions.

3D Vector Controls

Click and drag to rotate. Scroll to zoom.

Vector a
x = 2.0
y = 3.0
z = 1.0
|a| = 3.74
Vector b
x = -1.0
y = 2.0
z = 3.0
|b| = 3.74
Scalar k = 1.0

Applied to vector a


Magnitude and Direction

Magnitude (Length)

The magnitude (or length or norm) of a vector v\mathbf{v} is denoted v|\mathbf{v}| or v\|\mathbf{v}\|.

Magnitude Formulas

In 2D: For v=vx,vy\mathbf{v} = \langle v_x, v_y \rangle:

v=vx2+vy2|\mathbf{v}| = \sqrt{v_x^2 + v_y^2}

In 3D: For v=vx,vy,vz\mathbf{v} = \langle v_x, v_y, v_z \rangle:

v=vx2+vy2+vz2|\mathbf{v}| = \sqrt{v_x^2 + v_y^2 + v_z^2}

These formulas come from the Pythagorean theorem. In 2D, the vector forms the hypotenuse of a right triangle with legs vxv_x and vyv_y.

Direction

In 2D, direction is often specified by an angle θ\theta measured counterclockwise from the positive x-axis:

θ=arctan(vyvx)\theta = \arctan\left(\frac{v_y}{v_x}\right)

Be Careful with arctan

The standard arctan\arctan only gives angles in (π/2,π/2)(-\pi/2, \pi/2). Use atan2(vy,vx)\text{atan2}(v_y, v_x) (available in most programming languages) to get the correct angle in all four quadrants.

In 3D, direction is specified by either:

  • Direction cosines: The cosines of angles with each axis
  • Direction angles: The angles α,β,γ\alpha, \beta, \gamma with the x, y, and z axes
  • Unit vector: The normalized vector pointing in the same direction

Unit Vectors

Definition: Unit Vector

A unit vector is a vector with magnitude 1. It specifies a direction without regard to length.

Given any non-zero vector v\mathbf{v}, the unit vector in the same direction is:

v^=vv\hat{\mathbf{v}} = \frac{\mathbf{v}}{|\mathbf{v}|}

The "hat" notation (v^\hat{\mathbf{v}}) indicates a unit vector.

Finding a unit vector is called normalizing the vector. This process is essential when you need direction without magnitude — for example, when specifying the direction of movement regardless of speed.

Interactive Unit Vector Demonstration

Explore the relationship between a vector and its unit vector. The unit vector (shown dashed in green) always lies on the unit circle and points in the same direction as the original vector.

Unit Vector Explorer

Angle θ = 45°
Magnitude |v| = 3.0
Vector v = (2.12, 2.12)
Unit vector v̂ = (0.707, 0.707)

The unit vector always has magnitude 1 and points in the same direction as v.

= v / |v| = (cos θ, sin θ)

Computing Unit Vectors

For v=(3,4)\mathbf{v} = (3, 4):

1. Find magnitude: v=9+16=5|\mathbf{v}| = \sqrt{9 + 16} = 5

2. Divide each component: v^=(35,45)=(0.6,0.8)\hat{\mathbf{v}} = \left(\frac{3}{5}, \frac{4}{5}\right) = (0.6, 0.8)

Verify: 0.62+0.82=0.36+0.64=10.6^2 + 0.8^2 = 0.36 + 0.64 = 1


Vector Operations

Vector Addition

Vectors add component-wise:

a+b=ax+bx,ay+by\mathbf{a} + \mathbf{b} = \langle a_x + b_x, a_y + b_y \rangle
(and similarly in 3D)

Geometric interpretation:

  • Parallelogram law: Place both vectors at the same starting point; the sum is the diagonal of the parallelogram they form
  • Head-to-tail: Place the tail of b\mathbf{b} at the head of a\mathbf{a}; the sum goes from the tail of a\mathbf{a} to the head of b\mathbf{b}

Vector Subtraction

Vector subtraction is also component-wise:

ab=axbx,ayby\mathbf{a} - \mathbf{b} = \langle a_x - b_x, a_y - b_y \rangle

Geometric interpretation: ab\mathbf{a} - \mathbf{b} points from the tip of b\mathbf{b} to the tip of a\mathbf{a} when both start at the origin.

Scalar Multiplication

Multiplying a vector by a scalar kk scales each component:

kv=kvx,kvyk\mathbf{v} = \langle kv_x, kv_y \rangle

Geometric interpretation:

  • If k>1k > 1: The vector is stretched (lengthened)
  • If 0<k<10 < k < 1: The vector is shrunk
  • If k<0k < 0: The vector is reversed and scaled
  • If k=0k = 0: The result is the zero vector

Properties of Vector Operations

Vector operations satisfy the same algebraic properties as regular number arithmetic:

PropertyAdditionScalar Multiplication
Commutativea + b = b + a
Associative(a + b) + c = a + (b + c)k(m·v) = (km)v
Identityv + 0 = v1·v = v
Inversev + (−v) = 0
Distributivek(a + b) = ka + kb
Distributive(k + m)v = kv + mv

Zero Vector Properties

The zero vector 0\mathbf{0} is special:

  • v+0=v\mathbf{v} + \mathbf{0} = \mathbf{v} (additive identity)
  • 0v=00 \cdot \mathbf{v} = \mathbf{0} (scalar multiplication by 0)
  • 0=0|\mathbf{0}| = 0 (zero magnitude)
  • Direction is undefined

Standard Basis Vectors

The standard basis vectors are unit vectors along each coordinate axis:

i
(1, 0, 0)
x-direction
j
(0, 1, 0)
y-direction
k
(0, 0, 1)
z-direction

Any vector can be written as a linear combination of basis vectors:

v=vxi+vyj+vzk\mathbf{v} = v_x\mathbf{i} + v_y\mathbf{j} + v_z\mathbf{k}

For example, 3,2,5=3i2j+5k\langle 3, -2, 5 \rangle = 3\mathbf{i} - 2\mathbf{j} + 5\mathbf{k}.

Why Basis Vectors Matter

Basis vectors are fundamental because they let us decompose any vector into independent components. This decomposition is essential for:

  • Computing projections and components along specific directions
  • Setting up coordinate systems for physics problems
  • Understanding linear independence and span
  • Building the foundation for linear algebra

Applications in Science and Engineering

Physics: Forces and Motion

When multiple forces act on an object, we find the net force by vector addition:

Example: A boat travels at 10 m/s east while a river current flows at 3 m/s north.

Velocity vector: vboat=10,0\mathbf{v}_{boat} = \langle 10, 0 \rangle

Current vector: vcurrent=0,3\mathbf{v}_{current} = \langle 0, 3 \rangle

Resultant: vtotal=10,3\mathbf{v}_{total} = \langle 10, 3 \rangle

Speed: vtotal=100+910.44|\mathbf{v}_{total}| = \sqrt{100 + 9} \approx 10.44 m/s

Heading: θ=arctan(3/10)16.7°\theta = \arctan(3/10) \approx 16.7° north of east

Computer Graphics: Transformations

In 3D graphics, vectors represent:

  • Positions: Vertex locations in 3D models
  • Normals: Surface directions for lighting calculations
  • Directions: Camera viewing directions, light rays

Pilots and navigators use vectors constantly. Wind correction, course plotting, and ground speed calculations all involve vector addition to account for wind vectors affecting aircraft velocity vectors.


Machine Learning Applications

Vectors are the fundamental data structure in machine learning. Understanding vector operations is essential for every ML practitioner.

Feature Vectors

In ML, each data point is represented as a feature vector — a vector in high-dimensional space where each dimension corresponds to a feature.

Example: A house with 1500 sqft, 3 bedrooms, 2 bathrooms, and 10 years old becomes:

x = (1500, 3, 2, 10)

Word Embeddings

Modern NLP represents words as vectors in a high-dimensional space (typically 100-300 dimensions). Similar words have similar vectors, enabling semantic operations:

king − man + woman ≈ queen

Vector arithmetic captures semantic relationships!

Gradient Vectors

In optimization, the gradient is a vector pointing in the direction of steepest increase of a function. For a loss function L(w)L(\mathbf{w}) with parameters w=(w1,w2,...,wn)\mathbf{w} = (w_1, w_2, ..., w_n):

L=(Lw1,Lw2,...,Lwn)\nabla L = \left( \frac{\partial L}{\partial w_1}, \frac{\partial L}{\partial w_2}, ..., \frac{\partial L}{\partial w_n} \right)

Gradient descent updates parameters by moving in the opposite direction of the gradient to minimize loss.


Python Implementation

Vector Basics with NumPy

NumPy is the standard library for vector operations in Python. Here's how to work with vectors:

Vector Operations with NumPy
🐍vectors_basics.py
8Creating 2D Vectors

NumPy arrays are the standard way to represent vectors in Python. The array [3, 4] represents the vector from origin to point (3, 4).

EXAMPLE
This is the position vector pointing 3 units right and 4 units up.
15Vector Addition

Adding vectors is component-wise: (3, 4) + (1, 2) = (3+1, 4+2) = (4, 6). This follows the parallelogram law.

16Vector Subtraction

Subtracting vectors is also component-wise. The result a - b points from the tip of b to the tip of a.

17Scalar Multiplication

Multiplying by a scalar scales each component: 2 * (3, 4) = (6, 8). This doubles the length while keeping the same direction.

21Vector Magnitude

np.linalg.norm() computes the Euclidean length: |a| = sqrt(3^2 + 4^2) = 5. This is the distance from origin to the point.

25Unit Vector

Dividing by magnitude gives a unit vector: a/|a| has length 1 and points in the same direction. This preserves direction but normalizes length.

373D Vectors

3D vectors have three components (x, y, z). All operations extend naturally: addition, magnitude, and unit vectors work the same way.

91 lines without explanation
1import numpy as np
2import matplotlib.pyplot as plt
3from mpl_toolkits.mplot3d import Axes3D
4
5# ============================================
6# VECTORS IN 2D
7# ============================================
8
9# Creating 2D vectors using NumPy arrays
10a = np.array([3, 4])
11b = np.array([1, 2])
12
13print("Vector a:", a)
14print("Vector b:", b)
15
16# Vector operations
17print("\n--- Vector Operations ---")
18print("a + b =", a + b)           # Addition
19print("a - b =", a - b)           # Subtraction
20print("2 * a =", 2 * a)           # Scalar multiplication
21print("-b =", -b)                  # Negation
22
23# Magnitude (length) of a vector
24magnitude_a = np.linalg.norm(a)
25print("\n|a| =", magnitude_a)
26
27# Unit vector (direction without magnitude)
28unit_a = a / np.linalg.norm(a)
29print("Unit vector of a:", unit_a)
30print("Magnitude of unit vector:", np.linalg.norm(unit_a))
31
32# ============================================
33# VECTORS IN 3D
34# ============================================
35
36# Creating 3D vectors
37v = np.array([1, 2, 3])
38w = np.array([4, 5, 6])
39
40print("\n--- 3D Vectors ---")
41print("v =", v)
42print("w =", w)
43print("v + w =", v + w)
44print("|v| =", np.linalg.norm(v))
45
46# Unit vector in 3D
47unit_v = v / np.linalg.norm(v)
48print("Unit vector of v:", unit_v)
49
50# ============================================
51# VISUALIZATION
52# ============================================
53
54# 2D vector plot
55fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(14, 6))
56
57# Plot 2D vectors
58origin = np.array([0, 0])
59ax1.quiver(*origin, *a, angles='xy', scale_units='xy', scale=1,
60           color='blue', label='a = (3, 4)')
61ax1.quiver(*origin, *b, angles='xy', scale_units='xy', scale=1,
62           color='red', label='b = (1, 2)')
63ax1.quiver(*origin, *(a+b), angles='xy', scale_units='xy', scale=1,
64           color='green', label='a + b')
65
66ax1.set_xlim(-1, 6)
67ax1.set_ylim(-1, 7)
68ax1.grid(True, alpha=0.3)
69ax1.set_aspect('equal')
70ax1.legend()
71ax1.set_title('2D Vectors and Addition')
72ax1.set_xlabel('x')
73ax1.set_ylabel('y')
74
75# Show head-to-tail addition
76ax1.quiver(*a, *b, angles='xy', scale_units='xy', scale=1,
77           color='red', alpha=0.5, linestyle='--')
78
79# 3D vector plot
80ax2 = fig.add_subplot(122, projection='3d')
81ax2.quiver(0, 0, 0, *v, color='blue', arrow_length_ratio=0.1,
82           label='v = (1, 2, 3)')
83ax2.quiver(0, 0, 0, *w, color='red', arrow_length_ratio=0.1,
84           label='w = (4, 5, 6)')
85ax2.quiver(0, 0, 0, *(v+w), color='green', arrow_length_ratio=0.1,
86           label='v + w')
87
88ax2.set_xlim([0, 7])
89ax2.set_ylim([0, 8])
90ax2.set_zlim([0, 10])
91ax2.set_xlabel('X')
92ax2.set_ylabel('Y')
93ax2.set_zlabel('Z')
94ax2.legend()
95ax2.set_title('3D Vectors')
96
97plt.tight_layout()
98plt.show()

Vectors in Machine Learning

Here's how vectors appear in practical ML applications:

Vectors in Machine Learning
🐍vectors_ml.py
8Feature Vectors

In ML, each data sample is represented as a vector of features. A house with 1500 sqft, 3 bedrooms, 2 bathrooms, and 10 years old becomes the vector [1500, 3, 2, 10].

19Dot Product for Predictions

Linear models compute predictions using the dot product: y = w · x + b. The @ operator in NumPy performs matrix-vector multiplication.

EXAMPLE
price = 0.1*1500 + 50000*3 + 25000*2 + (-1000)*10 + 100000
27Word Embeddings

Modern NLP represents words as high-dimensional vectors. Similar words have similar vectors, and arithmetic operations capture semantic relationships.

34Vector Arithmetic on Words

The famous example: king - man + woman ≈ queen. Vector subtraction removes &apos;male&apos; attributes, addition adds &apos;female&apos; attributes.

42Cosine Similarity

Cosine similarity measures the angle between vectors, not their magnitude. It&apos;s widely used for comparing word vectors and finding similar documents.

58Gradient Vector

The gradient is a vector pointing in the direction of steepest increase of a function. In ML, we move opposite to the gradient to minimize loss.

73 lines without explanation
1import numpy as np
2
3# ============================================
4# VECTORS IN MACHINE LEARNING
5# ============================================
6
7# Feature vectors: Each sample is a vector
8# Example: House features [area_sqft, bedrooms, bathrooms, age]
9house_1 = np.array([1500, 3, 2, 10])
10house_2 = np.array([2000, 4, 3, 5])
11house_3 = np.array([1200, 2, 1, 25])
12
13# Stack into a matrix (each row is a sample)
14X = np.array([house_1, house_2, house_3])
15print("Feature matrix X shape:", X.shape)  # (3 samples, 4 features)
16
17# Weight vector for linear regression
18# y = w · x + b  (dot product!)
19weights = np.array([0.1, 50000, 25000, -1000])
20bias = 100000
21
22# Predict prices using dot product
23predictions = X @ weights + bias  # Matrix-vector multiplication
24print("\nPredicted prices:", predictions)
25
26# ============================================
27# WORD EMBEDDINGS: Words as Vectors
28# ============================================
29
30# Simplified word embeddings (real ones have 300+ dimensions)
31embeddings = {
32    'king':   np.array([0.9, 0.8, 0.1, 0.2]),
33    'queen':  np.array([0.9, 0.2, 0.9, 0.2]),
34    'man':    np.array([0.5, 0.9, 0.1, 0.1]),
35    'woman':  np.array([0.5, 0.1, 0.9, 0.1]),
36}
37
38# Famous analogy: king - man + woman ≈ queen
39result = embeddings['king'] - embeddings['man'] + embeddings['woman']
40print("\n--- Word Vector Arithmetic ---")
41print("king - man + woman =", result)
42print("Actual queen vector =", embeddings['queen'])
43
44# Find closest word using cosine similarity
45def cosine_similarity(a, b):
46    return np.dot(a, b) / (np.linalg.norm(a) * np.linalg.norm(b))
47
48print("\nSimilarity of result to 'queen':",
49      cosine_similarity(result, embeddings['queen']))
50
51# ============================================
52# GRADIENT VECTORS IN OPTIMIZATION
53# ============================================
54
55def loss_function(w):
56    """MSE loss for simple linear model y = wx on data."""
57    X = np.array([1, 2, 3, 4, 5])
58    y = np.array([2, 4, 5, 4, 5])
59    predictions = w * X
60    return np.mean((predictions - y) ** 2)
61
62def gradient(w):
63    """Gradient of MSE loss with respect to w."""
64    X = np.array([1, 2, 3, 4, 5])
65    y = np.array([2, 4, 5, 4, 5])
66    return 2 * np.mean(X * (w * X - y))
67
68# Gradient descent
69w = 0.0  # Initial weight
70learning_rate = 0.1
71
72print("\n--- Gradient Descent ---")
73for i in range(10):
74    grad = gradient(w)
75    w = w - learning_rate * grad  # Update in negative gradient direction
76    if i < 5:
77        print(f"Step {i+1}: w = {w:.4f}, gradient = {grad:.4f}")
78
79print(f"Final weight: {w:.4f}")

Common Pitfalls

Pitfall 1: Confusing Position and Direction

A vector (3,4)(3, 4) doesn't represent "the point at (3, 4)" — it represents any arrow with that displacement. The position vector from origin to (3, 4) happens to have these components, but the same vector could start at (1, 1) and end at (4, 5).

Pitfall 2: Adding Scalars and Vectors

You cannot add a scalar to a vector directly. 3+v3 + \mathbf{v} is not defined. You can only add a scalar after appropriate broadcasting in programming contexts.

Pitfall 3: Dividing Vectors

There is no standard vector division operation. a/b\mathbf{a} / \mathbf{b} is not defined. You can divide by scalars, but not by other vectors.

Pitfall 4: Magnitude is Always Non-negative

Even if a vector has negative components, its magnitude is always 0\geq 0. The vector (3,4)(-3, -4) has magnitude 5, not -5.


Test Your Understanding

Question 1 of 8Score: 0

What is the magnitude of the vector v = (3, 4)?


Summary

Vectors are mathematical objects that capture both magnitude and direction, making them essential for describing physical quantities like velocity, force, and displacement.

Key Concepts

ConceptDescription
VectorAn object with magnitude and direction
Component formv = (vₓ, vᵧ) in 2D or (vₓ, vᵧ, vᵤ) in 3D
Magnitude|v| = √(vₓ² + vᵧ²) — the length
Unit vectorv̂ = v/|v| — direction with magnitude 1
Vector additionComponent-wise: (a + b) = (aₓ + bₓ, aᵧ + bᵧ)
Scalar multiplicationkv = (kvₓ, kvᵧ) — scales the vector
Standard basisi = (1, 0, 0), j = (0, 1, 0), k = (0, 0, 1)

Key Takeaways

  1. Vectors combine magnitude (how much) and direction (which way)
  2. In coordinates, vectors are represented by ordered lists of components
  3. Vector magnitude is computed using the Pythagorean theorem
  4. Unit vectors have magnitude 1 and represent pure direction
  5. Addition and scalar multiplication are performed component-wise
  6. The standard basis vectors i, j, k allow any vector to be expressed as a linear combination
  7. Vectors are fundamental in physics, graphics, and machine learning
The Essence of Vectors:
"Vectors give us a language for describing quantities that have both size and direction — from the forces that shape our physical world to the high-dimensional spaces where machine learning algorithms discover patterns."
Coming Next: In the next section, we'll explore the Dot Product — a powerful operation that multiplies two vectors to produce a scalar. The dot product reveals the angle between vectors and enables projections, work calculations, and similarity measurements in machine learning.
Loading comments...