@thi.ng/vectors
Version:
Optimized 2d/3d/4d and arbitrary length vector operations, support for memory mapping/layouts
63 lines • 2.55 kB
TypeScript
import { type IRandom } from "@thi.ng/random";
import type { VecOpOOO } from "./api.js";
/**
* Sets `a` to random 2D vector, with each component in the semi-open interval
* `[b,c)`. If no `rnd` instance is given, uses
* [`SYSTEM`](https://docs.thi.ng/umbrella/random/variables/SYSTEM.html).
* Creates new vector if `a` is null.
*
* **IMPORTANT:** The non-fixed sized version of this function can ONLY be used
* if `a` is given and initialized to the desired size/length.
*
* @param a - vector
* @param b - scalar (min. bounds, default: -1)
* @param c - scalar (max. bounds, default: 1)
* @param rnd - PRNG instance
*/
export declare const random2: VecOpOOO<number, number, IRandom>;
/**
* Sets `a` to random 3D vector, with each component in the semi-open interval
* `[b,c)`. If no `rnd` instance is given, uses
* [`SYSTEM`](https://docs.thi.ng/umbrella/random/variables/SYSTEM.html).
* Creates new vector if `a` is null.
*
* **IMPORTANT:** The non-fixed sized version of this function can ONLY be used
* if `a` is given and initialized to the desired size/length.
*
* @param a - vector
* @param b - scalar (min. bounds, default: -1)
* @param c - scalar (max. bounds, default: 1)
* @param rnd - PRNG instance
*/
export declare const random3: VecOpOOO<number, number, IRandom>;
/**
* Sets `a` to random 4D vector, with each component in the semi-open interval
* `[b,c)`. If no `rnd` instance is given, uses
* [`SYSTEM`](https://docs.thi.ng/umbrella/random/variables/SYSTEM.html).
* Creates new vector if `a` is null.
*
* **IMPORTANT:** The non-fixed sized version of this function can ONLY be used
* if `a` is given and initialized to the desired size/length.
*
* @param a - vector
* @param b - scalar (min. bounds, default: -1)
* @param c - scalar (max. bounds, default: 1)
* @param rnd - PRNG instance
*/
export declare const random4: VecOpOOO<number, number, IRandom>;
/**
* Sets `a` to random vector, with each component in the semi-open interval
* `[b,c)`. If no `rnd` instance is given, uses
* [`SYSTEM`](https://docs.thi.ng/umbrella/random/variables/SYSTEM.html).
* Creates new vector if `a` is null.
*
* **IMPORTANT:** The non-fixed sized version of this function can ONLY be used
* if `a` is given and initialized to the desired size/length.
*
* @param a - vector
* @param b - scalar (min. bounds, default: -1)
* @param c - scalar (max. bounds, default: 1)
* @param rnd - PRNG instance
*/
export declare const random: VecOpOOO<number, number, IRandom>;
//# sourceMappingURL=random.d.ts.map