package me.vrekt.lunar.utilities;

public class Utilities {
	/**
	 * Round.
	 */
	public static int roundToDimensions(int value, int nearestValue) {
		return Math.round(value / nearestValue) * nearestValue;
	}

	public static double distance(int x, int y, int xx, int yy) {
        double dx = xx - x;
        double dy = yy - y;
	    return Math.sqrt(dx*dx + dy*dy);
    }
}

@@ -218,165 +218,739 @@
 %0D%0A%0D%0A
-%09public static double distance(int x, int y, int xx, int yy) %7B%0D%0A        double dx = xx - x;%0D%0A        double dy = yy - y;%0D%0A%09    return Math.sqrt(dx*dx + dy*dy
+    /**%0D%0A     * Calculate the Pythagorean distance from (x, y) to (xx, yy)%0D%0A     */%0D%0A%09public static double distance(double x, double y, double xx, double yy) %7B%0D%0A        double dx = xx - x;%0D%0A        double dy = yy - y;%0D%0A%09    return Math.sqrt(dx*dx + dy*dy);%0D%0A    %7D%0D%0A%0D%0A    /**%0D%0A     * Calculate the Manhattan distance from (x, y) to (xx, yy). Useful for tile based movement.%0D%0A     */%0D%0A    public static double manhattanDistance(double x, double y, double xx, double yy) %7B%0D%0A        return Math.abs((x - xx) + (y - yy));%0D%0A    %7D%0D%0A%0D%0A    /**%0D%0A     * Clamp a value between a lower and an upper bound%0D%0A     */%0D%0A    public static double clamp(double value, double lower, double upper) %7B%0D%0A        return Math.max(Math.min(value, upper), lower
 );%0D%0A

Add documentation and more helpers to Utilities