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

Function computeTriMiddle

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

Source from the content-addressed store, hash-verified

399// Compute triangle midpoint.
400// Mutates `middle` property of given `poly`.
401function computeTriMiddle(poly) {
402 const v = poly.vertices;
403 poly.middle.x = (v[0].x + v[1].x + v[2].x) / 3;
404 poly.middle.y = (v[0].y + v[1].y + v[2].y) / 3;
405 poly.middle.z = (v[0].z + v[1].z + v[2].z) / 3;
406}
407
408// Compute quad midpoint.
409// Mutates `middle` property of given `poly`.

Callers 1

computePolyMiddleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected