def calc_angle(per, line):
    """
    Calculate angle between two vector.
    Take into consideration a quarter circle

    :param per: first vector
    :type per: DB.XYZ
    :param line: second vector
    :type line: DB.XYZ
    :return: Angle between [-pi, pi]
    :rtype: float
    """
    return (1 if per.Y >= 0 else -1) * per.AngleTo(line)