public static double normalizeRadians(double r) {
        if (r < 0 && r >= -TWO_PI) return r + TWO_PI;
        if (r >= TWO_PI && r < FOUR_PI) return r - TWO_PI;
        if (r >= 0 && r < TWO_PI) return r;

        r -= TWO_PI * Math.floor(r * TWO_PI_INVERSE);
        if (r < 0.) r += TWO_PI;

        return r;
    }
Reduce an angle in radians to the range (0 - 2 Pi).

@param r Value in radians.

@return The reduced radian value.
src/main/java/eu/hansolo/tilesfx/tools/SunMoonCalculator.java