UNPKG

@jscad/modeling

Version:

Constructive Solid Geometry (CSG) Library for JSCAD

18 lines (16 loc) 453 B
/** * Scales the coordinates of the given vector by a scalar number. * * @param {vec3} out - receiving vector * @param {vec3} vector - vector to scale * @param {Number} amount - amount to scale the vector by * @returns {vec3} out * @alias module:modeling/maths/vec3.scale */ const scale = (out, vector, amount) => { out[0] = vector[0] * amount out[1] = vector[1] * amount out[2] = vector[2] * amount return out } module.exports = scale