StackGenVis: Alignment of Data, Algorithms, and Models for Stacking Ensemble Learning Using Performance Metrics https://doi.org/10.1109/TVCG.2020.3030352
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
StackGenVis/frontend/node_modules/gl-vec4/random.js

25 lines
630 B

4 years ago
var vecNormalize = require('./normalize')
var vecScale = require('./scale')
module.exports = random
/**
* Generates a random vector with the given scale
*
* @param {vec4} out the receiving vector
* @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned
* @returns {vec4} out
*/
function random (out, scale) {
scale = scale || 1.0
// TODO: This is a pretty awful way of doing this. Find something better.
out[0] = Math.random()
out[1] = Math.random()
out[2] = Math.random()
out[3] = Math.random()
vecNormalize(out, out)
vecScale(out, out, scale)
return out
}