UNPKG

@haiku/player

Version:

Haiku Player is a JavaScript library for building user interfaces

17 lines 427 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); function normalize(out, a) { var x = a[0]; var y = a[1]; var z = a[2]; var len = x * x + y * y + z * z; if (len > 0) { len = 1 / Math.sqrt(len); out[0] = a[0] * len; out[1] = a[1] * len; out[2] = a[2] * len; } return out; } exports.default = normalize; //# sourceMappingURL=normalize.js.map