function testCircleCircle(circle1, circle2) {
  if (circleHasNoSize(circle1) || circleHasNoSize(circle2)) {
    return false;
  }

  const dx = circle1.cx - circle2.cx;
  const dy = circle1.cy - circle2.cy;
  const sqrDist = Math.pow(dx, 2) + Math.pow(dy, 2);

  if (sqrDist <= Math.pow(circle1.r + circle2.r, 2)) {
    return true;
  }
  return false;
}
/**
 * Test if a Circle collide with another Circle. If so, returns true and false otherwise.
 * Both circles muse have a radius greater then 0.
 * @private
 * @param {object} circle
 * @param {number} circle.cx - center x-coordinate
 * @param {number} circle.cy - center y-coordinate
 * @param {number} circle.r - circle radius
 * @param {object} circle
 * @param {number} circle.cx - center x-coordinate
 * @param {number} circle.cy - center y-coordinate
 * @param {number} circle.r - circle radius
 * @return {boolean} true if circle collide with circle
 */
Test if a Circle collide with another Circle. If so, returns true and false otherwise.
Both circles muse have a radius greater then 0.
Test if a Circle collide with another Circle . If so returns true and false otherwise . Both circles muse have a radius greater then 0 .
function testCircleCircle(circle1, circle2) {
  if (circleHasNoSize(circle1) || circleHasNoSize(circle2)) {
    return false;
  }
  const dx = circle1.cx - circle2.cx;
  const dy = circle1.cy - circle2.cy;
  const sqrDist = Math.pow(dx, 2) + Math.pow(dy, 2);
  if (sqrDist <= Math.pow(circle1.r + circle2.r, 2)) {
    return true;
  }
  return false;
}
function testCircleCircle ( circle1 , circle2 ) { if ( circleHasNoSize ( circle1 ) || circleHasNoSize ( circle2 ) ) { return false ; } const dx = circle1 . cx - circle2 . cx ; const dy = circle1 . cy - circle2 . cy ; const sqrDist = Math . pow ( dx , 2 ) + Math . pow ( dy , 2 ) ; if ( sqrDist <= Math . pow ( circle1 . r + circle2 . r , 2 ) ) { return true ; } return false ; }
Test if a Circle collide with another Circle.
Test if a Circle collide with another Circle .