function [xNew,yNew] = Normalize(x,y)
% x and y are column n-vectors that define the vertices of a polygon P.
% xNew and yNew are the vertices of a polygon obtained by scaling P so that
% the vertex furthest from the origin is on the unit circle

% Max distance to origin...
d = max(sqrt(x.^2 + y.^2));

% Normalize so furthest vertex is on the unit circle..
xNew = x/d; yNew = y/d;