Skip to content

Instantly share code, notes, and snippets.

View michax's full-sized avatar

Michal Kulinski michax

  • Poland
View GitHub Profile
@michax
michax / circumcircle.js
Created March 2, 2016 02:04 — forked from mutoo/circumcircle.js
a very fast algorithm for getting the circumcircle from a triangle - http://www.exaflop.org/docs/cgafaq/cga1.html#Subject 1.04
function circumcircle(a, b, c) {
this.a = a
this.b = b
this.c = c
var A = b.x - a.x,
B = b.y - a.y,
C = c.x - a.x,
D = c.y - a.y,
E = A * (a.x + b.x) + B * (a.y + b.y),