MCPcopy
hub / github.com/tdewolff/minify / normalize

Function normalize

_benchmarks/sample_echarts.js:766–777  ·  view source on GitHub ↗
(out, v)

Source from the content-addressed store, hash-verified

764 return out;
765 }
766 function normalize(out, v) {
767 var d = len(v);
768 if (d === 0) {
769 out[0] = 0;
770 out[1] = 0;
771 }
772 else {
773 out[0] = v[0] / d;
774 out[1] = v[1] / d;
775 }
776 return out;
777 }
778 function distance(v1, v2) {
779 return Math.sqrt((v1[0] - v2[0]) * (v1[0] - v2[0])
780 + (v1[1] - v2[1]) * (v1[1] - v2[1]));

Callers 3

sample_echarts.jsFile · 0.70
forceLayoutFunction · 0.70
adjustEdgeFunction · 0.70

Calls 1

lenFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…