function [c, s] = givens(x, y)
	% Computes a Givens rotation for
	% the input 2-vector [x; y]

	if x ~= 0
		t = y/x;
		c = 1/ sqrt(1+t*t);
		s = c*t;
	else
		c = 0;
		s = 1;
	end
end
