No BSD License  

Highlights from
Templates for the Solution of Linear Systems

image thumbnail

Templates for the Solution of Linear Systems

by

 

19 Aug 2002 (Updated )

Companion Software

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

%
% Compute the Givens rotation matrix parameters for a and b.
%
   if ( b == 0.0 ),
      c = 1.0;
      s = 0.0;
   elseif ( abs(b) > abs(a) ),
      temp = a / b;
      s = 1.0 / sqrt( 1.0 + temp^2 );
      c = temp * s;
   else
      temp = b / a;
      c = 1.0 / sqrt( 1.0 + temp^2 );
      s = temp * c;
   end

Contact us