MCPcopy Create free account
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / normalize

Function normalize

assets/js/block_ninja.js:352–359  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

350////////////////////
351
352const normalize = v => {
353 const mag = Math.hypot(v.x, v.y, v.z);
354 return {
355 x: v.x / mag,
356 y: v.y / mag,
357 z: v.z / mag
358 };
359}
360
361// Curried math helpers
362const add = a => b => a + b;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected