MCPcopy
hub / github.com/CesiumGS/cesium / normalize

Function normalize

packages/engine/Source/Scene/Expression.js:504–518  ·  view source on GitHub ↗
(call, left)

Source from the content-addressed store, hash-verified

502}
503
504function normalize(call, left) {
505 if (typeof left === "number") {
506 return 1.0;
507 } else if (left instanceof Cartesian2) {
508 return Cartesian2.normalize(left, scratchStorage.getCartesian2());
509 } else if (left instanceof Cartesian3) {
510 return Cartesian3.normalize(left, scratchStorage.getCartesian3());
511 } else if (left instanceof Cartesian4) {
512 return Cartesian4.normalize(left, scratchStorage.getCartesian4());
513 }
514
515 throw new RuntimeError(
516 `Function "${call}" requires a vector or number argument. Argument is ${left}.`,
517 );
518}
519
520function distance(call, left, right) {
521 if (typeof left === "number" && typeof right === "number") {

Callers

nothing calls this directly

Calls 1

normalizeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…