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

Method dot

src/math/p5.Vector.js:1389–1400  ·  view source on GitHub ↗

* @param {p5.Vector} v p5.Vector to be dotted. * @return {Number}

(...args)

Source from the content-addressed store, hash-verified

1387 * @return {Number}
1388 */
1389 dot(...args) {
1390 let vals = args;
1391 if (args[0] instanceof Vector) {
1392 vals = args[0].values;
1393 }
1394 const minDimension = prioritizeSmallerDimension(this.dimensions, vals);
1395 let sum = 0;
1396 for (let i = 0; i < minDimension; i++) {
1397 sum += this.values[i] * vals[i];
1398 }
1399 return sum;
1400 }
1401
1402 /**
1403 * Calculates the cross product of two vectors.

Callers 15

_orbitFreeMethod · 0.95
angleBetweenMethod · 0.95
slerpMethod · 0.95
reflectMethod · 0.95
fresnelShaderCallbackFunction · 0.80
fresnelShaderCallbackFunction · 0.80
p5.Vector.jsFile · 0.80
_getSphereMappingMethod · 0.80
makeFilterShaderFunction · 0.80
randomFunction · 0.80
lumaFunction · 0.80
_edgesToVerticesMethod · 0.80

Calls 1

Tested by

no test coverage detected