UNPKG

xiaohejs

Version:

🎈 小何同学的JavaScript工具箱

2 lines (1 loc) 262 B
import{points2array as r}from"./point2array.js";function t(t){const[o,n]=r(t).reduce(((r,t)=>(r[0].push(t[0]),r[1].push(t[1]),r)),[[],[]]);return o.sort(((r,t)=>r-t)),n.sort(((r,t)=>r-t)),[(o[0]+o[o.length-1])/2,(n[0]+n[n.length-1])/2]}export{t as planeCenter};