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

Function circumcenter

docs/app/js/sanddance-app.js:140190–140204  ·  view source on GitHub ↗
(ax, ay, bx, by, cx, cy)

Source from the content-addressed store, hash-verified

140188 return x * x + y * y;
140189}
140190function circumcenter(ax, ay, bx, by, cx, cy) {
140191 const dx = bx - ax;
140192 const dy = by - ay;
140193 const ex = cx - ax;
140194 const ey = cy - ay;
140195 const bl = dx * dx + dy * dy;
140196 const cl = ex * ex + ey * ey;
140197 const d = 0.5 / (dx * ey - dy * ex);
140198 const x = ax + (ey * bl - dy * cl) * d;
140199 const y = ay + (dx * cl - ex * bl) * d;
140200 return {
140201 x,
140202 y
140203 };
140204}
140205function quicksort(ids, dists, left, right) {
140206 if (right - left <= 20) for(let i = left + 1; i <= right; i++){
140207 const temp = ids[i];

Callers 1

updateMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected