|
|
◆ Drotg()
| Sub Drotg |
( |
A As |
Double, |
|
|
B As |
Double, |
|
|
C As |
Double, |
|
|
S As |
Double |
|
) |
| |
Constructs Givens plane rotation (BLAS 1)
- Purpose
- This routine constructs Givens plane rotation for the point (a, b) as below.
( c s ) * ( a ) = ( r )
( -s c ) ( b ) ( 0 )
where r = sign(sqrt(a^2 + b^2), a), if |a| > |b|,
r = sign(sqrt(a^2 + b^2), b), if |a| <= |b|,
c^2 + s^2 = 1.
The constructed plane rotation can be used by Drot to convert the points to the new coordinate system.
- Parameters
-
| [in,out] | A | [in] a value
[out] r value |
| [in,out] | B | [in] b value
[out] z value
= s (if |a| > |b|)
= 1/c (|a| <= |b| and c != 0)
= 1 (if |a| <= |b| and c = 0)
= 0 (if r = 0)
c and s can be reconstructed from z.
c = sqrt(1 - z^2), s = z (if z < 1)
c = 0, s = 1 (if z = 1)
c = 1/z, s = sqrt(1 - (1/z)^2) (if z > 1) |
| [out] | C | c (cosine) value.
= a/r (if r <> 0)
= 1 (if r = 0) |
| [out] | S | s (sine) value.
= b/r (if r <> 0)
= 0 (if r = 0) |
- Reference
- BLAS
|