def METHOD_NAME(angles):
    """Converts a set of Euler angles in ZYZ format to a quaternion."""
    qw = cos(angles[1] / 2) * cos(0.5 * (angles[0] + angles[2]))
    qx = -sin(angles[1] / 2) * sin(0.5 * (angles[0] - angles[2]))
    qy = sin(angles[1] / 2) * cos(0.5 * (angles[0] - angles[2]))
    qz = cos(angles[1] / 2) * sin(0.5 * (angles[0] + angles[2]))
    return stack([qw, qx, qy, qz])