lib/slidercalc.js
function getCircumCircle(p1, p2, p3) {
  var x1 = p1[0];
  var y1 = p1[1];

  var x2 = p2[0];
  var y2 = p2[1];

  var x3 = p3[0];
  var y3 = p3[1];

  //center of circle
  var D = 2 * (x1 * (y2 - y3) + x2 * (y3 - y1) + x3 * (y1 - y2));

  var Ux = ((x1 * x1 + y1 * y1) * (y2 - y3) + (x2 * x2 + y2 * y2) * (y3 - y1) + (x3 * x3 + y3 * y3) * (y1 - y2)) / D;
  var Uy = ((x1 * x1 + y1 * y1) * (x3 - x2) + (x2 * x2 + y2 * y2) * (x1 - x3) + (x3 * x3 + y3 * y3) * (x2 - x1)) / D;

  var px = Ux - x1;
  var py = Uy - y1;
  var r = Math.sqrt(px * px + py * py);

  return {
    cx: Ux,
    cy: Uy,
    radius: r
  };
}
function getCircumCircle(p1, p2, p3) {
  var x1 = p1[0];
  var y1 = p1[1];

  var x2 = p2[0];
  var y2 = p2[1];

  var x3 = p3[0];
  var y3 = p3[1];

  //center of circle
  var D = 2 * (x1 * (y2 - y3) + x2 * (y3 - y1) + x3 * (y1 - y2));

  var Ux = ((x1 * x1 + y1 * y1) * (y2 - y3) + (x2 * x2 + y2 * y2) * (y3 - y1) + (x3 * x3 + y3 * y3) * (y1 - y2)) / D;
  var Uy = ((x1 * x1 + y1 * y1) * (x3 - x2) + (x2 * x2 + y2 * y2) * (x1 - x3) + (x3 * x3 + y3 * y3) * (x2 - x1)) / D;

  var px = Ux - x1;
  var py = Uy - y1;
  var r = Math.sqrt(px * px + py * py);

  return {
    cx: Ux,
    cy: Uy,
    radius: r
  };
}
function getCircumCircle ( p1 , p2 , p3 ) { var x1 = p1 [ 0 ] ; var y1 = p1 [ 1 ] ; var x2 = p2 [ 0 ] ; var y2 = p2 [ 1 ] ; var x3 = p3 [ 0 ] ; var y3 = p3 [ 1 ] ; //center of circle var D = 2 * ( x1 * ( y2 - y3 ) + x2 * ( y3 - y1 ) + x3 * ( y1 - y2 ) ) ; var Ux = ( ( x1 * x1 + y1 * y1 ) * ( y2 - y3 ) + ( x2 * x2 + y2 * y2 ) * ( y3 - y1 ) + ( x3 * x3 + y3 * y3 ) * ( y1 - y2 ) ) / D ; var Uy = ( ( x1 * x1 + y1 * y1 ) * ( x3 - x2 ) + ( x2 * x2 + y2 * y2 ) * ( x1 - x3 ) + ( x3 * x3 + y3 * y3 ) * ( x2 - x1 ) ) / D ; var px = Ux - x1 ; var py = Uy - y1 ; var r = Math . sqrt ( px * px + py * py ) ; return { cx : Ux , cy : Uy , radius : r } ; }
Get circum circle of 3 points
@param  {Object} p1 first point
@param  {Object} p2 second point
@param  {Object} p3 third point
@return {Object} circumCircle
Get circum circle of 3 points