Docs: Update benchmark for openrouter/sherlock-dash-alpha

This commit is contained in:
github-actions[bot]
2025-11-16 00:31:49 +00:00
parent 9450b6f936
commit 24de0a1a87
10 changed files with 207 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
async function findConvexHull(points) {
const {_, default: _} = await import('https://cdn.skypack.dev/lodash-es');
const pts = _([...new Set(points.map(p=>`${p.x},${p.y}`))].map(s=>s.split(',').map(Number)).map(([x,y])=>({x,y})));
const ccw=(a,b,c)=> (b.x-a.x)*(c.y-a.y)-(b.y-a.y)*(c.x-a.x);
const build=(pts,low)=> {
const hull=[];
for(let p of pts){
while(hull.length>1&&ccw(hull[hull.length-2],hull[hull.length-1],p)<=0) hull.pop();
hull.push(p);
}
return hull.slice(0,low?hull.length:hull.length-1);
};
if(pts.length<3) return pts;
return [...build(pts.sort((a,b)=>a.x-b.x||a.y-b.y),1),...build(pts.slice().reverse(),0)];
}
export default findConvexHull;