Algoramic

Entry point


Subjects

  • Overview
    • Vector Operations
Privacy Policy·© Algoramic
HomeVector MathVector Operations

Vector Operations

Vector Math

By Victor Arce

Addition gets two vectors talking, but the everyday work of vector math needs three more moves: scaling a vector, subtracting one from another, and the dot product — which secretly measures how much two vectors point the same way.

Step through each on the grid below.

Log
Step 1 of 7Start with vector a = (3, 1). Every operation below builds a new vector from ones you already have.

Scaling and subtraction

Scalar multiplication stretches a vector without turning it: 2a is twice as long and points the same way; a negative scalar flips it around. It's how you change a vector's length while keeping (or reversing) its direction.

Subtraction is addition's mirror: a − b is the vector that takes you from b to a. Geometrically it's the arrow joining the two tips; algebraically you just subtract componentwise, (3, 1) − (1, 2) = (2, −1). This is the workhorse for "difference between two points" — displacement, direction-to-target, edges of a shape.

The dot product

The dot product a · b = a₁b₁ + a₂b₂ collapses two vectors into a single number, and that number has a clean geometric meaning: a · b = |a| |b| cos θ, where θ is the angle between them. So the dot product is largest when the vectors point the same way, zero when they're perpendicular, and negative when they oppose.

The animation shows the other reading: drop b straight onto the line of a, and the shadow it casts is the projection, with length a · b / |a|. Projection is how you answer "how much of b goes in the direction of a?" — the basis of lighting in graphics, of components in physics, and of least-squares in data.

Sources
  • Lay, D. C., Lay, S. R., & McDonald, J. J. (2021). Linear Algebra and Its Applications (6th ed.). Pearson. — Vector operations, dot product, projections.
  • Strang, G. (2016). Introduction to Linear Algebra (5th ed.). Wellesley-Cambridge Press. — Geometry of the dot product.
PreviousWhat Is a Vector?NextDerived Vector Operations

Back to Vector Math