MCPcopy
hub / github.com/processing/p5.js / prioritizeSmallerDimension

Function prioritizeSmallerDimension

src/math/p5.Vector.js:12–20  ·  view source on GitHub ↗
(currentVectorDimension, args)

Source from the content-addressed store, hash-verified

10 * and to emit a warning when lengths do not match.
11 */
12const prioritizeSmallerDimension = function (currentVectorDimension, args) {
13 const resultDimension = Math.min(currentVectorDimension, args.length);
14 if (Array.isArray(args) && currentVectorDimension !== args.length) {
15 console.warn(
16 'When working with two vectors of different sizes, the smaller dimension is used. In this operation, both vector will be treated as ' + resultDimension + 'D vectors, and any additional values of the linger vector will be ignored.'
17 );
18 }
19 return resultDimension;
20};
21
22/**
23 * @private

Callers 7

addMethod · 0.85
remMethod · 0.85
subMethod · 0.85
multMethod · 0.85
divMethod · 0.85
dotMethod · 0.85
distMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected