rotg(3F)

SROTG, DROTG - Constructs a Givens plane rotation

As shipped in IRIX 6.5.19. Last changed in IRIX 6.5.19.

NAME
     SROTG, DROTG - Constructs a Givens plane rotation

SYNOPSIS
     Real

        CALL SROTG (a, b, c, s)

     Double precision

        CALL DROTG (a, b, c, s)

DESCRIPTION
     DROTG/SROTG computes the elements of a rotation matrix such that:

          _      _     _   _    _   _
          | c  s |     | a |    | r |
          |-s  c | *   | b | =  | 0 |
          -      -     -   -    -   -

     where

          r = +- sqrt (a2 + b2) and c2 + s2 = 1

     These routines have the following arguments:

     a      First vector component.  (input and output)

            SROTG (Real), DROTG (Double precision):
            On input, the first component of the vector to be rotated.  On
            output, a is overwritten by by r, the first component of the
            vector in the rotated coordinate system where:

            r = sign(sqrt(a2 + b2),a), if |a| > |b|



            r = sign(sqrt(a2 + b2),b), if |a| <= |b|

     b     Second vector component. (input and output)
           SROTG: Real.
           DROTG: Double precision.
           On input, the second component of the vector to be rotated.  On
           output, b contains z, where:
           z=s  if |a| > |b|
           z=1/c     if |a| <= |b| and c / 0
           z=1  if c = 0.

     c     Cosine of the angle of rotation. (output)
           SROTG: Real.
           DROTG: Double precision.

     s     Sine of the angle of rotation. (output)
           SROTG: Real.
           DROTG: Double precision.



NOTES
     SROTG/DROTG routines are Level 1 Basic Linear Algebra Subprograms
     (Level 1 BLAS).

     The value of z, returned in b by SROTG, gives a compact representation
     of the rotation matrix, which can be used later to reconstruct c and s
     as in the following example:

          IF (B .EQ. 1. ) THEN
             C = 0.
             S = 1.
          ELSEIF( ABS( B) .LT. 1) THEN
             C = SQRT( 1. - B * B)
             S = B
          ELSE
             C = 1. / B
             S = SQRT( 1 - C * C)
          ENDIF

SEE ALSO
     ROT(3F), ROTM(3F), ROTMG(3F)