← Lessons

quiz vs the machine

Silver1050

Algorithms

Points and Vectors Basics

The atoms of geometry: coordinates, displacement vectors, and the two products that drive everything.

4 min read · intro · beat Silver to climb

Points versus vectors

A point is a location in the plane, written as a pair of coordinates. A vector is a direction with a magnitude, often formed as the difference between two points. Subtracting point A from point B gives the displacement vector that takes you from A to B.

  • A point answers where.
  • A vector answers which way and how far.

The dot product

The dot product of two vectors multiplies matching coordinates and sums them. It measures how aligned the vectors are. It is positive when they point a similar way, zero when they are perpendicular, and negative when they oppose.

  • Used to find angles between directions.
  • Used to project one vector onto another.

The cross product

In two dimensions the cross product is a single scalar that captures the signed area of the parallelogram the vectors span. Its sign tells you the turn direction, which is the workhorse of geometric algorithms.

Why this matters

Almost every geometry routine reduces to dot and cross products on small vectors. Mastering these two operations means you rarely need messy trigonometry.

Key idea

Treat points as locations and vectors as displacements, then lean on the dot product for alignment and the cross product for turn direction to express most geometry without trigonometry.

Check yourself

Answer to earn rating on the learn ladder.

1. What does subtracting one point from another produce?

2. When is the dot product of two vectors zero?