Module 1: Vectors
You can add vectors together. But you can also do something simpler: take a single vector and scale it — make it longer, shorter, or flip it around. That operation is called scalar multiplication.
A scalar is just a plain number — no direction, no components, just a magnitude. The number 3 is a scalar. So is −0.5, or π. When you multiply a vector by a scalar, you're resizing the arrow.
Multiplying by 2 doubles the length. Multiplying by 0.5 halves it. The direction stays exactly the same — the arrow just gets longer or shorter.
Multiplying by −1 reverses the direction. The arrow points the opposite way, but has the same length. Multiplying by −2 doubles the length and flips the direction.
Multiplying by 0 gives the zero vector [0, 0]. No length, no direction — just a point sitting at the origin. It's the additive identity: add it to anything and nothing changes.
The rule is simple: multiply each component by the scalar.
So 3⋅[2, 1]=[6, 3]. The vector triples in length and keeps pointing the same way.
If the original vector has length ∥v∥, then the scaled vector has length ∣s∣⋅∥v∥. The absolute value of the scalar tells you how much the length changes; the sign tells you whether the direction flips.
import numpy as np
v = np.array([2, 2])
print(3 * v) # [ 6 6] — stretch
print(-1 * v) # [-2 -2] — flip
print(0.5 * v) # [1. 1.] — shrinkNumPy broadcasts scalar multiplication across every element. Same rule, same result — and it works on vectors of any length.
Scalar multiplication is one half of a bigger idea coming up shortly: linear combinations. When you can both scale vectors and add them together, you can reach any point in space — or describe complex motions as weighted sums of simpler ones.