@woosh/meep-engine
Version:
Pure JavaScript game engine. Fully featured and production ready.
25 lines • 1.02 kB
TypeScript
/**
* Computes the Givens rotation coefficients (c, s) such that
*
* [ c s ] [ a ] [ r ]
* [ -s c ] [ b ] = [ 0 ]
*
* with c^2 + s^2 = 1 (so the matrix is a proper rotation).
*
* Signs are not pinned down — `r` may be either +sqrt(a^2 + b^2) or its
* negation depending on the branch taken. Callers that care about the sign
* of `r` must apply the rotation explicitly and read the rotated value.
*
* Writes c to out[0] and s to out[1]. Designed to take an out-param rather
* than return an object: returning a freshly-allocated {c, s} pair would
* cost an allocation per call, which matters when this is invoked inside a
* tight QR-update loop.
*
* Source: Golub & Van Loan, Matrix Computations 2nd ed., p. 216.
*
* @param {number} a
* @param {number} b
* @param {Float64Array|number[]} out length >= 2; receives [c, s]
*/
export function givens_rotation_coefficients(a: number, b: number, out: Float64Array | number[]): void;
//# sourceMappingURL=givens_rotation_coefficients.d.ts.map