def vector2plungetrend(vector):
    """Converts a :math:`\\mathbb{R}^3` vector to the **plunge**
    :math:`\\delta`, **trend** :math:`\\delta_\\mathrm{dir}` notation used in
    Structural Geology and Rock Mechanics.

    The :math:`\\mathbb{R}^3` notation is assumed to be coincident with the
    **NED** notation (*i.e* North, East, Nadir).

    Parameters:
        vector (`list` or `numpy.ndarray`): :math:`\\left(x, y, z \\right)`
            vector.

    Returns:
        (`tuple`): :math:`\\left(\\delta, \\delta_\\mathrm{dir}\\right)` of            the input vector in degrees.

    Examples:
        >>> from jelinekstat.tools import vector2plungetrend
        >>> vector = [1, 0, 0]
        >>> vector2plungetrend(vector)
        (0.0, 0.0)

        >>> from jelinekstat.tools import vector2plungetrend
        >>> vector = [0, 1, 0]
        >>> vector2plungetrend(vector)
        (0.0, 90.0)

        >>> from jelinekstat.tools import vector2plungetrend
        >>> vector = [1, 1, 1]
        >>> vector2plungetrend(vector)
        (35.264389682754654, 45.0)
    """
    import numpy as np
    vector = np.array(vector)
    x = vector[0]
    y = vector[1]
    z = vector[2]
    plunge = np.degrees(np.arctan(z / np.sqrt(x ** 2 + y ** 2)))
    trend = np.degrees(np.arctan2(y, x)) % 360
    if plunge < 0:
        trend = (trend + 180) % 360
    return abs(plunge), trend
