Pythagorean Theorem & Vector Normalization

Calculate Vector Length Using Pythagorean Theorem

Click anywhere on the grid to set the endpoint of the vector
X: 3.0
Y: 4.0
|v| = √(x² + y²)
|v| = √(3² + 4²) = √(9 + 16) = √25 = 5

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:

  • The horizontal side has length |x|
  • The vertical side has length |y|
  • The hypotenuse represents the vector's length |v|

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

Click anywhere on the grid to set the endpoint of the vector
X: 3.0
Y: 4.0
Original Vector
v = (3.0, 4.0)
|v| = 5.0
Normalized Vector
v̂ = (0.6, 0.8)
|v̂| = 1.0
v̂ = v / |v| = (x/|v|, y/|v|)
v̂ = (3, 4) / 5 = (0.6, 0.8)

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:

  1. Calculate the vector's length using the Pythagorean theorem: |v| = √(x² + y²)
  2. Divide each component by the length: v̂ = v / |v| = (x/|v|, y/|v|)

The resulting normalized vector v̂ has the same direction as the original vector v, but has a length of exactly 1.