givens

PURPOSE ^

Givens plane rotation [c s;-s c]. Entries c and s

SYNOPSIS ^

function [c s] = givens(a,b)

DESCRIPTION ^

 Givens plane rotation [c s;-s c]. Entries c and s
 are computed using numbers x1 and x2.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [c s] = givens(a,b)
0002 % Givens plane rotation [c s;-s c]. Entries c and s
0003 % are computed using numbers x1 and x2.
0004 if b==0
0005     c = 1; s=0;
0006 else
0007     if abs(b)> abs(a)
0008         tau = -a/b; s=1/sqrt(1+tau^2); c=s*tau;
0009     else
0010         tau = -b/a; c=1/sqrt(1+tau^2); s = c*tau;
0011     end
0012 end

Generated on Mon 10-Jun-2013 23:03:23 by m2html © 2005