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

Function inCircle

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

Source from the content-addressed store, hash-verified

140164 return sign < 0;
140165}
140166function inCircle(ax, ay, bx, by, cx, cy, px, py) {
140167 const dx = ax - px;
140168 const dy = ay - py;
140169 const ex = bx - px;
140170 const ey = by - py;
140171 const fx = cx - px;
140172 const fy = cy - py;
140173 const ap = dx * dx + dy * dy;
140174 const bp = ex * ex + ey * ey;
140175 const cp = fx * fx + fy * fy;
140176 return dx * (ey * cp - bp * fy) - dy * (ex * cp - bp * fx) + ap * (ex * fy - ey * fx) < 0;
140177}
140178function circumradius(ax, ay, bx, by, cx, cy) {
140179 const dx = bx - ax;
140180 const dy = by - ay;

Callers 1

_legalizeMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected