function r2 = pyts(x) % function r2 = pyts(x) % Uses the theorem of Pythagoras to compute length of vector. r2 = x(1).^2 + x(2).^2;