Category: Linear Algebra Level: 301
v = (vx, vy), |v| = √(vx2 + vy2)
A vector is an arrow from the origin. Its components say how far it goes along each axis, and the Pythagorean theorem gives its length.
The vector v starts at the origin and ends at the point (3, 4). The arrow has a direction and a length.
v = (3, 4)
The first component is the horizontal distance. Go 3 units to the right.
vx = 3
The second component is the vertical distance. From (3, 0) go 4 units up. The two components meet at a right angle.
vy = 4
The arrow is the hypotenuse of a right triangle with legs 3 and 4. The Pythagorean theorem gives its length, and the old 3-4-5 triangle shows up again.
|v| = √(32 + 42) = √(25) = 5
Divide each component by the length 5. The result points the same way and has length 1, so it ends on the unit circle.
v/|v| = (3/5, 4/5) = (0.6, 0.8)
cd svg-generator python3 -m svgmath render vector-components --out /tmp/vector-components
Source: svgmath/diagrams/vectors.py