Adding vectors and scaling them never leave the vectors' own world: the answer is another vector. The dot product is different. It takes two vectors of and returns a number, by multiplying matching components and adding the results:
For and that is . The recipe is symmetric, so ; it is built from products and sums, so it distributes, , and scalars pull out, . And a vector dotted with itself is the sum of its squared components, which you have met already:
So is never negative, and it is zero only for the zero vector. Length is a dot product in disguise, and that is the first hint that this number knows geometry.
What it knows is the angle. The figure fixes , puts on three sliders, and fills the angle between them with a sector lying in the plane the two vectors span.
Explore in 3D (opens in a new tab)The fixed vector and the movable , with the angle between them drawn as a filled sector inside the translucent plane they span. The dashed gray side joining their tips is , the third side of the triangle the law of cosines will use.
Explore the figure
At the starting values , both vectors lie in the floor and the sector is an eighth of a turn: the angle is . Compute the number: , while , and , which is .
Drag to . The vector lifts off the floor, the plane tilts with it, and the sector opens. The dot product is still , because has nothing in the third component to multiply against; but has grown to , so the cosine has dropped to and the angle is about .
Set and , with any . Now , and the sector is a quarter turn — a right angle. Sweep through its whole range and watch the sector stay a quarter turn: every vector is perpendicular to , a whole plane of them.
Set , and , so that . The sector is a half disk, , and the dot product is , the most negative it can be for this length. Then set and : the two vectors coincide, the sector collapses, and the dot product is the most positive.
The law of cosines, rewritten
Draw and from a common tail, with the angle between them, . The vector from the tip of to the tip of closes a triangle whose sides have lengths , and , and the law of cosines from trigonometry says
Now expand the left side with the dot product's own rules. Since a squared length is a self dot product, , and distributing gives . Setting the two expansions equal, the squared lengths cancel and what remains is
That is the geometric meaning of the dot product: the product of the two lengths, discounted by the cosine of the angle between them. Read backwards, it computes the angle from components alone, — and since nothing in the derivation used a picture beyond the triangle, the same formula defines the angle between two vectors of , where no protractor could reach.
Two consequences carry the rest of the book. First, the sign of the dot product is the sign of the cosine: positive means the angle is acute, the vectors lean the same way; negative means obtuse. Second, and most important, the dot product is zero exactly when , that is, when . Two vectors with are called orthogonal. For nonzero vectors in the plane or in space, orthogonal simply means perpendicular; the word is chosen because the test makes sense in , and even for the zero vector, which is orthogonal to everything without having an angle with anything.
The dot product at the figure's starting values ✓ Computed · mojocas 0.1.0✓ Agrees with the text The dot product at the figure's starting values, computed exactly by mojocas 0.1.0, and confirmed to agree with the result stated in the text.
The two vectors of the figure at its default, handed to a computer algebra system: .
And the angle they make, exactly ✓ Computed · mojocas 0.1.0✓ Agrees with the text And the angle they make, exactly, computed exactly by mojocas 0.1.0, and confirmed to agree with the result stated in the text.
The same two vectors, and the number the sector in the figure is drawing: the engine computes , recognizes the cosine as , and returns exactly . Step 1 asks you to read that off the figure; this is the same claim with no eye in the loop. A decimal such as would be refuted here rather than accepted, which is why the starting components were chosen to land on a closed form.
A whole plane of perpendicular vectors ✓ Computed · mojocas 0.1.0✓ Agrees with the text A whole plane of perpendicular vectors, computed exactly by mojocas 0.1.0, and confirmed to agree with the result stated in the text.
Step 3 of the exploration claims that is perpendicular to for every value of the slider, and a figure can only show you the values you drag to. Here the third component is left as the symbol and the dot product still comes back — a statement about the whole slider, and about the values beyond its ends.
The worked example's dot product ✓ Computed · mojocas 0.1.0✓ Agrees with the text The worked example's dot product, computed exactly by mojocas 0.1.0, and confirmed to agree with the result stated in the text.
The dot product of and : . Over the product of lengths , that is the cosine of the worked example.
Its angle, in closed form ✓ Computed · mojocas 0.1.0✓ Agrees with the text Its angle, in closed form, computed exactly by mojocas 0.1.0, and confirmed to agree with the result stated in the text.
And the angle itself. is not one of the nine angles the engine folds to a closed form, so it ships exactly as written rather than as the the prose rounds to — the decimal is the approximation, and this is the number.
The right-angle condition, solved ✓ Computed · mojocas 0.1.0✓ Agrees with the text The right-angle condition, solved, computed exactly by mojocas 0.1.0, and confirmed to agree with the result stated in the text.
The orthogonality condition , written out and handed to a computer algebra system: one root, .
An original work of XYZ Homework, built around interactive XYZ 3D figures. Its chapter sequence is aligned to Interactive Linear Algebra (Margalit & Rabinoff, Georgia Tech, GNU FDL); this work is original, copies nothing from it, and is not affiliated with or endorsed by its authors. License: CC-BY-NC-SA-4.0.
These eBooks are a prerelease and are not yet certified conformant with WCAG 2.1 AA or ADA Title II. Every page is built against an automated accessibility gate, and the published editions will meet ADA Title II requirements when they release in late September 2026. If something is unusable, please tell us.