src/gamemechanics/Util.java
public static MapLocation moveCircleAround(MapLocation center, MapLocation pointOnCircle, boolean positive) {
		// Line inside the Circle
		float y = rc.getType().strideRadius;
		// alpha angle of the triangle were moving along
		float alpha = acrd(y, center.distanceTo(pointOnCircle));
		// the sin of alpha ^^
		float x = (float) Math.sin(alpha);
		if (x == 0) {
			// Should never happen :D
			debug_println("moveCircleAround Division by Zero");
			// Hopefully ~Rene
			return new MapLocation(0, 0);
		}
		// The angle we need to move
		float beta = (float) Math.asin(x / y);
		// Direction between center and pointOnCircle
		Direction direction = center.directionTo(pointOnCircle);
		// Left right degrees Rads ...
		if (positive) {
			direction = direction.rotateLeftDegrees(90).rotateLeftRads(beta);
		} else {
			direction = direction.rotateRightDegrees(90).rotateRightRads(beta);
		}
		MapLocation moveTo = pointOnCircle.add(direction, y);
		return moveTo;
	}
/**
	 * Calculate the Point you should walk to if you want to wander in a circle
	 * around center
	 * 
	 * @param center
	 *            The center you walk around
	 * @param pointOnCircle
	 *            Current position
	 * @param positive
	 *            Direction
	 * @return Position where you should move to
	 */
Calculate the Point you should walk to if you want to wander in a circle
around center

@param center
The center you walk around
@param pointOnCircle
Current position
@param positive
Direction
@return Position where you should move to
Calculate the Point you should walk to if you want to wander in a circle around center @param center The center you walk around @param pointOnCircle Current position @param positive Direction @return Position where you should move to
public static MapLocation moveCircleAround(MapLocation center, MapLocation pointOnCircle, boolean positive) {
		float y = rc.getType().strideRadius;
		float alpha = acrd(y, center.distanceTo(pointOnCircle));
		float x = (float) Math.sin(alpha);
		if (x == 0) {
			debug_println("moveCircleAround Division by Zero");
			return new MapLocation(0, 0);
		}
		float beta = (float) Math.asin(x / y);
		Direction direction = center.directionTo(pointOnCircle);
		if (positive) {
			direction = direction.rotateLeftDegrees(90).rotateLeftRads(beta);
		} else {
			direction = direction.rotateRightDegrees(90).rotateRightRads(beta);
		}
		MapLocation moveTo = pointOnCircle.add(direction, y);
		return moveTo;
	}
public static MapLocation moveCircleAround ( MapLocation center , MapLocation pointOnCircle , boolean positive ) { float y = rc . getType ( ) . strideRadius ; float alpha = acrd ( y , center . distanceTo ( pointOnCircle ) ) ; float x = ( float ) Math . sin ( alpha ) ; if ( x == 0 ) { debug_println ( "moveCircleAround Division by Zero" ) ; return new MapLocation ( 0 , 0 ) ; } float beta = ( float ) Math . asin ( x / y ) ; Direction direction = center . directionTo ( pointOnCircle ) ; if ( positive ) { direction = direction . rotateLeftDegrees ( 90 ) . rotateLeftRads ( beta ) ; } else { direction = direction . rotateRightDegrees ( 90 ) . rotateRightRads ( beta ) ; } MapLocation moveTo = pointOnCircle . add ( direction , y ) ; return moveTo ; }
Calculate the Point you should walk to if you want to wander in a circle
 around center
Calculate the Point you should walk to if you want to wander in a circle around center
// Line inside the Circle // alpha angle of the triangle were moving along // the sin of alpha ^^ // Should never happen :D // Hopefully ~Rene // The angle we need to move // Direction between center and pointOnCircle // Left right degrees Rads ...