1function [x, y] = norm2(x, y)
2%NORM2  Normalize x and y
3%
4%   [x, y] = NORM2(x, y) normalize x and y so that x^2 + y^2 = 1.  x and y
5%   can be any shape.
6
7  r = hypot(x, y);
8  x = x ./ r;
9  y = y ./ r;
10end
11