index.js
function _polarRadian(xyCenter, xyPointsArray) {
  // simplify the math by moving the computed circle center to [0, 0]
  var xAdj = 0 - xyCenter[0],
      yAdj = 0 - xyCenter[1];

  return _.map(xyPointsArray, function(xy){
    // reposition x and y relative to adjusted [0, 0] center
    var x = xy[0] + xAdj;
    var y = xy[1] + yAdj;

    var adjArcTan = Math.atan2(y, x);

    // compensate for quad3 and quad4 results
    if(adjArcTan < 0){
      adjArcTan = 2 * Math.PI + adjArcTan;
    }

    return adjArcTan;
  });
}
function _polarRadian(xyCenter, xyPointsArray) {
  // simplify the math by moving the computed circle center to [0, 0]
  var xAdj = 0 - xyCenter[0],
      yAdj = 0 - xyCenter[1];

  return _.map(xyPointsArray, function(xy){
    // reposition x and y relative to adjusted [0, 0] center
    var x = xy[0] + xAdj;
    var y = xy[1] + yAdj;

    var adjArcTan = Math.atan2(y, x);

    // compensate for quad3 and quad4 results
    if(adjArcTan < 0){
      adjArcTan = 2 * Math.PI + adjArcTan;
    }

    return adjArcTan;
  });
}
function _polarRadian ( xyCenter , xyPointsArray ) { // simplify the math by moving the computed circle center to [0, 0] var xAdj = 0 - xyCenter [ 0 ] , yAdj = 0 - xyCenter [ 1 ] ; return _ . map ( xyPointsArray , function ( xy ) { // reposition x and y relative to adjusted [0, 0] center var x = xy [ 0 ] + xAdj ; var y = xy [ 1 ] + yAdj ; var adjArcTan = Math . atan2 ( y , x ) ; // compensate for quad3 and quad4 results if ( adjArcTan < 0 ) { adjArcTan = 2 * Math . PI + adjArcTan ; } return adjArcTan ; } ) ; }
_polarRadian compute radian component of polar coordinate relative to a center point
@param  {Array} xyCenter         [x, y] center point to anchor radial sweep
@param  {Array} xyPointsArray    Array of [x, y] arrays -- one for each point to index
@return {Array}                  the radian position (between 0 and 2PI) of each coordinate
_polarRadian compute radian component of polar coordinate relative to a center point