Vectors

A track of P84 · Angles, Trigonometry & Vectors.

Quantities with a size and a direction: displacements that add tip to tail, components from an angle through sine and cosine, and the dot and cross products for angles, work and torque.

"Five kilometres" says how far; "five kilometres north-east" says where. A vector is the second kind of statement: a size and a direction together, drawn as an arrow and stored as a list of components. This track starts with displacements, the moves of a walk, and shows why they add as arrows, tip to tail, while their lengths do not: 3 km east and 4 km north leave you 5 km from the start, not 7.

From there it builds the two pictures of a vector and the bridge between them. A length and an angle become components through sine and cosine; components become a length through Pythagoras and an angle through atan2. Then the track multiplies vectors two ways. The dot product is a number that measures angles, shadows and the work a force does; the cross product is a vector at right angles to both, the one physics uses for torque and angular momentum. You will compute both with numpy, then build the cross product by hand and find which laws of ordinary multiplication it breaks.

Physics leans on this track from its first lesson on motion: a velocity, a force and a torque are each a vector, and adding forces is adding arrows. The machine-learning pages of Data Science & AI use the same vectors with hundreds of components, where the dot product measures how alike two embeddings are: the geometry is the same, only the arrows can no longer be drawn.

Arrowsize and directionComponents(x, y, z)Dota number: angle, workCrossa vector: torque
From an arrow to the two ways of multiplying vectors.
Vectors — TransformerLab