MCPcopy Create free account
hub / github.com/microsoft/SandDance / normalize

Method normalize

docs/app/js/sanddance-app.js:69184–69188  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

69182 return (0, _validators.checkNumber)(product);
69183 }
69184 normalize() {
69185 const length = this.magnitude();
69186 if (length !== 0) for(let i = 0; i < this.ELEMENTS; ++i)this[i] /= length;
69187 return this.check();
69188 }
69189 multiply(...vectors) {
69190 for (const vector of vectors)for(let i = 0; i < this.ELEMENTS; ++i)this[i] *= vector[i];
69191 return this.check();

Callers 5

sanddance-app.jsFile · 0.45
tesselateIcosaHedronFunction · 0.45
DirectionalLight1Function · 0.45
getFrustumPlanesFunction · 0.45

Calls 2

magnitudeMethod · 0.95
checkMethod · 0.45

Tested by

no test coverage detected