function circumcircle([[x1, y1], [x2, y2], [x3, y3]]) {
const a2 = x1 - x2;
const a3 = x1 - x3;
const b2 = y1 - y2;
const b3 = y1 - y3;
const d1 = x1 * x1 + y1 * y1;
const d2 = d1 - x2 * x2 - y2 * y2;
const d3 = d1 - x3 * x3 - y3 * y3;
const ab = (a3 * b2 - a2 * b3) * 2;
const xa = (b2 * d3 - b3 * d2) / ab - x1;
const ya = (a3 * d2 - a2 * d3) / ab - y1;
if (isNaN(xa) || isNaN(ya)) return;
return {x: x1 + xa, y: y1 + ya, r: Math.sqrt(xa * xa + ya * ya)};
}