MCPcopy Create free account
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / computeQuadMiddle

Function computeQuadMiddle

assets/js/block_ninja.js:410–415  ·  view source on GitHub ↗
(poly)

Source from the content-addressed store, hash-verified

408// Compute quad midpoint.
409// Mutates `middle` property of given `poly`.
410function computeQuadMiddle(poly) {
411 const v = poly.vertices;
412 poly.middle.x = (v[0].x + v[1].x + v[2].x + v[3].x) / 4;
413 poly.middle.y = (v[0].y + v[1].y + v[2].y + v[3].y) / 4;
414 poly.middle.z = (v[0].z + v[1].z + v[2].z + v[3].z) / 4;
415}
416
417function computePolyMiddle(poly) {
418 if (poly.vertices.length === 3) {

Callers 1

computePolyMiddleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected