import math


def circular_easeinout(pos):
    """
    Easing function for animations: Circular Ease In & Out
    """
    if pos < 0.5:
        return 0.5 * (1 - math.sqrt(1 - 4 * (pos * pos)))
    return 0.5 * (math.sqrt(-((2 * pos) - 3) * ((2 * pos) - 1)) + 1)