Algoramic

Entry point


Subjects

  • Overview
    • What Is a Vector?
Privacy Policy·© Algoramic
HomeVector MathWhat Is a Vector?

What Is a Vector?

Vector MathFoundations

By Victor Arce

A vector is one of the most reused ideas in all of math and computing: a quantity with both a direction and a magnitude (a length). Think of a step "3 east and 1 north" — that pair is a vector, and you can draw it as an arrow. What makes vectors powerful is that the arrow's position doesn't matter, only how far it reaches and which way it points, so the same vector can be slid anywhere.

Step through it below. We start with a single vector, break it into its components, measure its length, then add a second vector the classic tip-to-tail way.

Log
Step 1 of 7A vector is an arrow in space: it has a direction and a length (its magnitude). Position doesn’t matter — only how far and which way.

Components and magnitude

On a grid, a 2-D vector is written as its components — how far it travels along each axis: a = (3, 1) means 3 along x and 1 along y. Components make vectors easy to compute with: you work on each axis independently.

The magnitude (length) follows from the Pythagorean theorem on those components: |a| = √(3² + 1²) = √10 ≈ 3.16. Direction and magnitude together are exactly what the arrow shows.

Adding vectors

There are two equivalent ways to add vectors, and the animation shows both at once:

  • Geometrically (tip-to-tail): slide the second arrow so its tail sits at the first arrow's tip. The sum is the arrow from the very start to the very end.
  • By components: just add the matching components. (3, 1) + (1, 3) = (4, 4).

They always agree — that is the whole point. Subtraction works the same way with the second vector reversed, and multiplying a vector by a number (a scalar) stretches or shrinks the arrow without turning it.

From these basics grow everything else in this category: the dot product (how much two vectors point the same way), the cross product, projections, and the way matrices transform whole grids of vectors at once.

Sources
  • Strang, G. (2016). Introduction to Linear Algebra (5th ed.). Wellesley-Cambridge Press. — Vectors, components, and linear combinations.
  • Lengyel, E. (2011). Mathematics for 3D Game Programming and Computer Graphics (3rd ed.). Cengage. — Vectors in graphics and geometry.
  • 3Blue1Brown, Essence of Linear Algebra. — Geometric intuition for vectors and their operations.
NextVector Operations

Back to Vector Math