The Pythagorean theorem states that in a right triangle, the square of the length of the hypotenuse equals the sum of squares of the other two sides.
For a vector v = (x, y), we can create a right triangle where:
Therefore, the vector's length (magnitude) is calculated as: |v| = √(x² + y²)
This extends to 3D vectors as well: |v| = √(x² + y² + z²)
Vector normalization is the process of converting a vector to a unit vector (a vector with length 1) while preserving its direction.
To normalize a vector:
The resulting normalized vector v̂ has the same direction as the original vector v, but has a length of exactly 1.