public static boolean intersectsCircle(Geo p1,Geo p2,Geo center,double radius){
  double d1=Geo.distance(p1,center);
  if (d1 < radius)   return true;
  double d2=Geo.distance(p2,center);
  if (d2 < radius)   return true;
  double dist=pointCircleDistance(p1,p2,center);
  if (dist > radius)   return false;
  Geo g=p1.cross(p2);
  Geo f=center.cross(g);
  Geo i=f.crossNormalize(g,g);
  double d=Geo.distance(p1,p2);
  if (center.distance(i) < radius) {
    double d11=Geo.distance(p1,i);
    double d12=Geo.distance(p2,i);
    return (d11 <= d && d12 <= d && Math.abs(d11 + d12 - d) < 0.01f);
  }
  Geo i2=i.antipode(i);
  if (center.distance(i2) < radius) {
    double d21=Geo.distance(p1,i2);
    double d22=Geo.distance(p2,i2);
    return (d21 <= d && d22 <= d && Math.abs(d21 + d22 - d) < 0.01f);
  }
  return false;
}

public static boolean intersectsCircle ( Geo p1 , Geo p2 , Geo center , double radius ) { double d1 = Geo . distance ( p1 , center ) ; if ( d1 < radius ) return true ; double d2 = Geo . distance ( p2 , center ) ; if ( d2 < radius ) return true ; double dist = pointCircleDistance ( p1 , p2 , center ) ; if ( dist > radius ) return false ; Geo g = p1 . cross ( p2 ) ; Geo f = center . cross ( g ) ; Geo i = f . crossNormalize ( g , g ) ; double d = Geo . distance ( p1 , p2 ) ; if ( center . distance ( i ) < radius ) { double d11 = Geo . distance ( p1 , i ) ; double d12 = Geo . distance ( p2 , i ) ; return ( d11 <= d && d12 <= d && Math . abs ( d11 + d12 - d ) < 0.01f ) ; } Geo i2 = i . antipode ( i ) ; if ( center . distance ( i2 ) < radius ) { double d21 = Geo . distance ( p1 , i2 ) ; double d22 = Geo . distance ( p2 , i2 ) ; return ( d21 <= d && d22 <= d && Math . abs ( d21 + d22 - d ) < 0.01f ) ; } return false ; }
returns true or false depending on whether the great circle seg from point p1 to point p2 intersects the circle of radius ( radians ) around center .
