@luma.gl/engine
Version:
3D Engine Components for luma.gl
17 lines • 440 B
JavaScript
// luma.gl
// SPDX-License-Identifier: MIT
// Copyright (c) vis.gl contributors
/** Creates a deterministic pseudorandom number generator */
export function makeRandomGenerator() {
let s = 1;
let c = 1;
return () => {
s = Math.sin(c * 17.23);
c = Math.cos(s * 27.92);
return fract(Math.abs(s * c) * 1432.71);
};
}
function fract(n) {
return n - Math.floor(n);
}
//# sourceMappingURL=random.js.map