Skip to content
Linear Algebra, Optimisation and Numerical Methods / Vectors, Linear Combinations, and the Dot Product

The Dot Product, Length, and Angle

Linear combinations give vectors algebra — addition and scaling — but no sense of size or alignment. The dot product supplies both in a single operation: it turns a pair of vectors into a number that measures how much they point the same way, and from that one number falls length, angle, and the algebraic test for perpendicularity. This is the tool a desk reaches for before running any statistics: the correlation between two return series is, underneath the formula, a cosine of an angle between two vectors — a fact this note sets up directly.
Learning objectives. By the end of this note you should be able to:
  • compute the dot product v⋅w\mathbf{v}\cdot\mathbf{w} and the induced length ∥v∥\lVert\mathbf{v}\rVert;
  • state and use the Cauchy–Schwarz inequality and the triangle inequality;
  • derive and apply the angle formula cos⁡θ=v⋅w/(∥v∥∥w∥)\cos\theta = \mathbf{v}\cdot\mathbf{w}/(\lVert\mathbf{v}\rVert\lVert\mathbf{w}\rVert);
  • test two vectors for orthogonality and explain the finance reading of a zero dot product.

In this lesson

  1. The dot product
  2. Length
  3. The angle between two vectors

Before you start

The full lesson, with worked examples and exercise solutions, is for members.

Read the full lesson

New to SelfMadeQuant.com? See membership options or browse the Linear Algebra, Optimisation and Numerical Methods syllabus.