MCPcopy Index your code
hub / github.com/plotly/plotly.js / normalize

Function normalize

stackgl_modules/index.js:25399–25412  ·  view source on GitHub ↗

* Normalize a vec3 * * @param {vec3} out the receiving vector * @param {vec3} a vector to normalize * @returns {vec3} out

(out, a)

Source from the content-addressed store, hash-verified

25397 * @returns {vec3} out
25398 */
25399function normalize(out, a) {
25400 var x = a[0],
25401 y = a[1],
25402 z = a[2]
25403 var len = x*x + y*y + z*z
25404 if (len > 0) {
25405 //TODO: evaluate use of glm_invsqrt here?
25406 len = 1 / Math.sqrt(len)
25407 out[0] = a[0] * len
25408 out[1] = a[1] * len
25409 out[2] = a[2] * len
25410 }
25411 return out
25412}
25413
25414/***/ }),
25415

Callers 6

angleFunction · 0.85
index.jsFile · 0.85
explodeFunction · 0.85
skeletonFunction · 0.85
boundaryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…