Vectors
Adding up the arrows…
Initializing Sorting Algorithms...
Sorting
Trees
Graphs
Preparing interactive visualizations...
Vectors
Adding up the arrows…
Multiply matching components and add — or take one vector's shadow on the other and multiply by the other's length. Two recipes, one number, and its sign tells you which way they lean.
Two vectors, a = (3, 1) and b = (1, 2). The dot product a · b turns them into a single number. There are two ways to get it, and the point of this page is that they always agree.
The value appears once the tour reaches it.
The two lines are the same number reached two ways. The thick segment on a's line is b's shadow, |b| cos θ: green when it falls along a, red when it falls behind.