MCPcopy Create free account
hub / github.com/microsoft/SandDance / planarRingArea

Function planarRingArea

docs/app/js/sanddance-app.js:109687–109691  ·  view source on GitHub ↗
(ring)

Source from the content-addressed store, hash-verified

109685var _stitchJs = require("./stitch.js");
109686var _stitchJsDefault = parcelHelpers.interopDefault(_stitchJs);
109687function planarRingArea(ring) {
109688 var i = -1, n = ring.length, a, b = ring[n - 1], area = 0;
109689 while(++i < n)a = b, b = ring[i], area += a[0] * b[1] - a[1] * b[0];
109690 return Math.abs(area); // Note: doubled area!
109691}
109692exports.default = function(topology) {
109693 return (0, _featureJs.object)(topology, mergeArcs.apply(this, arguments));
109694};

Callers 1

areaFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected