float xSquare2=x+dist;
float ySquare1=y-dist;
float ySquare2=y+dist;
if(xSquare1<=x2&&xSquare2>=x1&&ySquare1<=y1&&ySquare2>=y2){
return 1;
}
//check whether there is a vertex of the rectangle in the circle
//center of rectangle
float xrectangle=(x1+x2)/2;
float yrectangle=(y1+y2)/2;
//rectangle is on the top left side of circle
if(xrectangle<=x&&yrectangle<=y&&
sqrt((x2-x)*(x2-x)+(y2-y)*(y2-y))<=r)
return 1;
else if(xrectangle>x&&yrectangle<=y&&
sqrt((x1-x)*(x1-x)+(y2-y)*(y2-y))<=r)
return