MCPcopy Create free account
hub / github.com/breck7/scroll / circumradius

Function circumradius

external/.d3.js:7403–7417  ·  view source on GitHub ↗
(ax, ay, bx, by, cx, cy)

Source from the content-addressed store, hash-verified

7401}
7402
7403function circumradius(ax, ay, bx, by, cx, cy) {
7404 const dx = bx - ax;
7405 const dy = by - ay;
7406 const ex = cx - ax;
7407 const ey = cy - ay;
7408
7409 const bl = dx * dx + dy * dy;
7410 const cl = ex * ex + ey * ey;
7411 const d = 0.5 / (dx * ey - dy * ex);
7412
7413 const x = (ey * bl - dy * cl) * d;
7414 const y = (dx * cl - ex * bl) * d;
7415
7416 return x * x + y * y;
7417}
7418
7419function circumcenter(ax, ay, bx, by, cx, cy) {
7420 const dx = bx - ax;

Callers 1

updateMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected