import math


def xy_yaw_from_quaternion(quat):
    """Calculate the yaw angle in the xy plane from a rotation quaternion.
    :param quat: A unit quaternion representing the
    :type quat: Any container that has numerical values in index 0, 1, 2 and 3
    :return: The yaw angle in radians projected on the xy plane
    :rtype: float
    """
    x, y, z, w = quat[:4]
    return math.atan2(2 * z * w + 2 * x * y, w**2 + x**2 - y**2 - z**2)