Linear Algebra: Dot Product, Vector Length, Angles Between Vectors
Linear Algebra: Vector Dot Product
The dot product operation is a way to multiply a vector by another vector. Dot product notation is, not surprisingly, just a between two vectors: . ( between vectors is the cross product, a different vector multiplication). The dot product is defined as . The dot product takes two vectors, and generates just a number. For example, .
Dot Product Relation to Vector Length
To find the length of a vector in 2 dimensions, we just need to take the square root of its components squared. This is just the Pythagorean theorem. For example, , then its length denoted with double lines is . We can generalize this notion of length to any number of dimensions by adding additional vector terms to the sum under the sqrt. Generalized Pythagorean theorem: . Notice that a vector ”dotted” with itself, will get all the terms of the vector squared. So, to get the length using the dot product, we just need to take the square root of the vector ”dotted” with itself. .
Cauchy-Schwarz Inequality
The Cauchy-Schwarz Inequality relates vector dot products to vector magnitudes, and generalizes to any number of dimensions. The inequality states that the absolute values of the dot product of two vectors is less than the value of their lengths multiplied: where . The two vectors are only equal when they are colinear: .
Triangle Inequality
We can use the Cauchy-Schwarz Inequality to define a triangle inequality using any 2 vectors in any number of dimensions. The Triangle Inequality states that the sum of two sides of a triangle must be greater than or equal to the length of the third side. , only equal when talking about a line. We can expand this definition to vectors with , where they are only equal when the vectors are colinear.
Visually, if we take (1,3) and (3,4) we can create a triangle from their sum.

Or a line if the two vectors are colinear (drawn parallel to show better).

Angle Between Vectors, Perpendicularity, Orthogonality
We’ve defined the triangle inequality in any number of dimensions, and the payoff is that we can then define angles between vectors in any number of dimsensions. Let’s define a triangle with lengths and see if we can define angles between vectors using the triangle inequality and Law of Cosines .
Angles between vectors of any dimension are defined by . Vectors are perpendicular if the angle between them is 90 degrees, and orthoginal if their dot product is . Orthonormal means two vectors’ dot product is and each of their magnitudes is 1.