A unit vector means the vector’s length is 1.0.
A sum is the result of an addition. Example: 1 + 2 + 5 = 8. The sum is 8.
A product is the result of a multiplication. 2 * 3 = 6. The product is 6.
The square is a product of a value multiplied by itself.
12 squared is 144, because 12 * 12 = 144.
3 squared is 9, because 3 * 3 = 9
1 squared is 1, because 1 * 1 = 1
The square root is the number we need to multiply with itself to produce a square.
The square root of 100 is 10.
The square root of 9 is 3.
The square root of 8 is 2.82842712474619 (because 2.82842712474619 * 2.82842712474619 = 8)
The reciprocal is the result of one (1) divided by a number.
1 / 10 = 0.1. The reciprocal is 0.1.
1 / 0.5 = 2. The reciprocal of 0.5 is 2.
The length of a vector is the square root of the sum of all its dimensions squared.
sum = (x * x) + (y * y) + (z * z)
length = sqrt(sum)
The length of Vector(10, 20, 30) is 37.416573867739416
sum = (10 * 10) + (20 * 20) + (30 * 30)
length = sqrt(sum)
This vector is not normalized, because its length is not 1.0.
To normalize a vector means to scale the vector’s x/y/z so that when we compute the length, it produces 1.0.
We normalize by taking the reciprocal of the vector’s length and multiply it with each of x/y/z.
r = 1 / 37.416573867739416 = 0.026726124191242435
x = r * 10 = 0.26726124191242434
y = r * 20 = 0.5345224838248487
z = r * 30 = 0.8017837257372731
The normalized version of Vector(10, 20, 30) is… drumroll
Vector(0.26726124191242434, 0.5345224838248487, 0.8017837257372731)
We now have a unit vector. A normalized vector.