array-xy-weighted-merge
Merge abscissa values on similar ordinates and weight the group of abscissa.
Installation
$ npm install --save array-xy-weighted-merge
Usage
; const points = x: 100001 100002 20001 20002 3000001 3000002 y: 10 11 20 21 30 31; const merged = ;/*merged.x -> [ (100.002 * 10 + 100.001 * 11) / 21, (200.01 * 20 + 200.02 * 21) / 41, (300.0002 * 30 + 300.0001 * 31) / 61];merged.y -> [21, 41, 61];*/