|
| 1 | + |
| 2 | +{{alias}}( F, G, C, S, R ) |
| 3 | + Constructs a Givens rotation of a two-dimensional vector that zeros out the |
| 4 | + second component. |
| 5 | + |
| 6 | + For a two-dimensional vector `( F, G )` it computes the sine `S`, cosine `C` |
| 7 | + and the resultant `R`. |
| 8 | + |
| 9 | + Indexing is relative to the first index. To introduce an offset, use typed |
| 10 | + array views. |
| 11 | + |
| 12 | + Parameters |
| 13 | + ---------- |
| 14 | + F: Float64Array |
| 15 | + First component of the vector to be rotated. |
| 16 | + |
| 17 | + G: Float64Array |
| 18 | + Second component of the vector to be rotated. |
| 19 | + |
| 20 | + C: Float64Array |
| 21 | + Overwritten by the cosine of the rotation. |
| 22 | + |
| 23 | + S: Float64Array |
| 24 | + Overwritten by the sine of the rotation. |
| 25 | + |
| 26 | + R: Float64Array |
| 27 | + Overwritten by the length of the rotated vector. |
| 28 | + |
| 29 | + Returns |
| 30 | + ------- |
| 31 | + undefined |
| 32 | + Overwrites the arrays in place. |
| 33 | + |
| 34 | + Examples |
| 35 | + -------- |
| 36 | + > var F = new {{alias:@stdlib/array/float64}}( [ 3.0 ] ); |
| 37 | + > var G = new {{alias:@stdlib/array/float64}}( [ 4.0 ] ); |
| 38 | + > var C = new {{alias:@stdlib/array/float64}}( 1 ); |
| 39 | + > var S = new {{alias:@stdlib/array/float64}}( 1 ); |
| 40 | + > var R = new {{alias:@stdlib/array/float64}}( 1 ); |
| 41 | + > {{alias}}( F, G, C, S, R ); |
| 42 | + > R |
| 43 | + <Float64Array>[ 5.0 ] |
| 44 | + > C |
| 45 | + <Float64Array>[ 0.6 ] |
| 46 | + > S |
| 47 | + <Float64Array>[ 0.8 ] |
| 48 | + |
| 49 | + |
| 50 | +{{alias}}.ndarray( F, offsetF, G, offsetG, C, offsetC, S, offsetS, R, offsetR ) |
| 51 | + Constructs a Givens rotation of a two-dimensional vector that zeros out the |
| 52 | + second component, using alternative indexing semantics. |
| 53 | + |
| 54 | + For a two-dimensional vector `( F, G )` it computes the sine `S`, cosine `C` |
| 55 | + and the resultant `R`. |
| 56 | + |
| 57 | + While typed array views mandate a view offset based on the underlying |
| 58 | + buffer, the offset parameters support indexing semantics based on starting |
| 59 | + indices. |
| 60 | + |
| 61 | + Parameters |
| 62 | + ---------- |
| 63 | + F: Float64Array |
| 64 | + First component of the vector to be rotated. |
| 65 | + |
| 66 | + offsetF: integer |
| 67 | + Starting index for `F`. |
| 68 | + |
| 69 | + G: Float64Array |
| 70 | + Second component of the vector to be rotated. |
| 71 | + |
| 72 | + offsetG: integer |
| 73 | + Starting index for `G`. |
| 74 | + |
| 75 | + C: Float64Array |
| 76 | + Overwritten by the cosine of the rotation. |
| 77 | + |
| 78 | + offsetC: integer |
| 79 | + Starting index for `C`. |
| 80 | + |
| 81 | + S: Float64Array |
| 82 | + Overwritten by the sine of the rotation. |
| 83 | + |
| 84 | + offsetS: integer |
| 85 | + Starting index for `S`. |
| 86 | + |
| 87 | + R: Float64Array |
| 88 | + Overwritten by the length of the rotated vector. |
| 89 | + |
| 90 | + offsetR: integer |
| 91 | + Starting index for `R`. |
| 92 | + |
| 93 | + Returns |
| 94 | + ------- |
| 95 | + undefined |
| 96 | + Overwrites the arrays in place. |
| 97 | + |
| 98 | + Examples |
| 99 | + -------- |
| 100 | + > var F = new {{alias:@stdlib/array/float64}}( [ 0.0, 3.0 ] ); |
| 101 | + > var G = new {{alias:@stdlib/array/float64}}( [ 0.0, 4.0 ] ); |
| 102 | + > var C = new {{alias:@stdlib/array/float64}}( 2 ); |
| 103 | + > var S = new {{alias:@stdlib/array/float64}}( 2 ); |
| 104 | + > var R = new {{alias:@stdlib/array/float64}}( 2 ); |
| 105 | + > {{alias}}.ndarray( F, 1, G, 1, C, 1, S, 1, R, 1 ); |
| 106 | + > R |
| 107 | + <Float64Array>[ 0.0, 5.0 ] |
| 108 | + > C |
| 109 | + <Float64Array>[ 0.0, 0.6 ] |
| 110 | + > S |
| 111 | + <Float64Array>[ 0.0, 0.8 ] |
| 112 | + |
| 113 | + See Also |
| 114 | + -------- |
0 commit comments