MCPcopy Index your code
hub / github.com/plotly/plotly.js / convexHull1d

Function convexHull1d

stackgl_modules/index.js:9776–9794  ·  view source on GitHub ↗
(points)

Source from the content-addressed store, hash-verified

9774module.exports = convexHull1d
9775
9776function convexHull1d(points) {
9777 var lo = 0
9778 var hi = 0
9779 for(var i=1; i<points.length; ++i) {
9780 if(points[i][0] < points[lo][0]) {
9781 lo = i
9782 }
9783 if(points[i][0] > points[hi][0]) {
9784 hi = i
9785 }
9786 }
9787 if(lo < hi) {
9788 return [[lo], [hi]]
9789 } else if(lo > hi) {
9790 return [[hi], [lo]]
9791 } else {
9792 return [[lo]]
9793 }
9794}
9795
9796/***/ }),
9797

Callers 1

convexHullFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…