public static boolean isRatAndPiperAtSameRegion(int id, Point rat){
		double angle=Math.toDegrees(Math.atan((rat.x-Global.GATE.x)/(rat.y-Global.GATE.y)));
		
		
		if(angle<0)
			angle*=-1;
		else
			angle=(180-angle);
		
	
		
		if(id==0&&angle>=Global.thetas[id]){
				return true;
		}else if(id==Global.npipers-1&&angle<Global.thetas[id-1]){
				return true;
		}else{
			if(id!=Global.npipers-1&&angle>=Global.thetas[id]&&angle<Global.thetas[id-1]){
				return true;
			}
			
		}
		
		return false;
	}