public static double orbitalWallDistance(final Vector sourceLocation, final Vector targetLocation,
			final double bulletPower, final int direction, final Rectangle2D.Double battlefield) {
		final double absBearing = sourceLocation.angleTo(targetLocation);
		final double distance = sourceLocation.distance(targetLocation);
		final double maxEscapeAngle = Math.asin(8.0 / (20 - 3.0 * bulletPower));
		// 1.0 means the max range of orbital movement
		// exactly reaches bounds of battle field
		double wallDistance = 2.0;
		for (int x = 0; x < 200; x++) {
			if (!battlefield.contains(
					sourceLocation.x + Math.sin(absBearing + direction * (x / 100.0) * maxEscapeAngle) * distance,
					sourceLocation.y + Math.cos(absBearing + direction * (x / 100.0) * maxEscapeAngle) * distance)) {
				wallDistance = x / 100.0;
				break;
			}
		}
		return wallDistance;
	}