Vector normalization: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 1:
Vector Normalization
 
 
Objective:
 
Transform a vector so that its norm (or length) is equal to 1.
 
 
Procedure:
 
Given an n-dimensional vector x, its normalized version r is calculated by:
 
ri = xi/squareroot(sum_j=1..n(xj^2)), for i = 1...n;
 
 
Example:
 
given the 3-dimensional vector x = (3, 4, 5), i.e. x1 = 3, x2 = 4 and x3 = 5, its normalized version will be:
 
 
r1 = 3 / squareroot(sum(3^2+4^2+5^2))
 
r1 = 0.424
 
r2 = 4 / squareroot(sum(3^2+4^2+5^2))
 
r2 = 0.566
 
r3 = 5 / squareroot(sum(3^2+4^2+5^2))
 
r3 = 0.707
 
 
r = (0.424, 0.566, 0.707)
 
 
to verify the answer, one can compute the resulting norm:
 
||r|| = (0.424^2 + 0.566^2 + 0.707^2) = 1.000;