Return the dihedrals between given atoms.

        Calculates the dihedral angle in degrees between the atoms with
        indices ``i, b, a, d``.
        The indices can be given in three ways:

        * As simple list ``[i, b, a, d]``
        * As list of lists: ``[[i1, b1, a1, d1], [i2, b2, a2, d2]...]``
        * As :class:`pandas.DataFrame` where ``i`` is taken from the index and
          ``b``, ``a`` and ``d``from the respective columns
          ``'b'``, ``'a'`` and ``'d'``.

        Args:
            indices (list):

        Returns:
            :class:`numpy.ndarray`: Vector of angles in degrees.

def get_dihedral_degrees(self, indices, start_row=0):
        """Return the dihedrals between given atoms.

        Calculates the dihedral angle in degrees between the atoms with
        indices ``i, b, a, d``.
        The indices can be given in three ways:

        * As simple list ``[i, b, a, d]``
        * As list of lists: ``[[i1, b1, a1, d1], [i2, b2, a2, d2]...]``
        * As :class:`pandas.DataFrame` where ``i`` is taken from the index and
          ``b``, ``a`` and ``d``from the respective columns
          ``'b'``, ``'a'`` and ``'d'``.

        Args:
            indices (list):

        Returns:
            :class:`numpy.ndarray`: Vector of angles in degrees.
        """
        coords = ['x', 'y', 'z']
        if isinstance(indices, pd.DataFrame):
            i_pos = self.loc[indices.index, coords].values
            b_pos = self.loc[indices.loc[:, 'b'], coords].values
            a_pos = self.loc[indices.loc[:, 'a'], coords].values
            d_pos = self.loc[indices.loc[:, 'd'], coords].values
        else:
            indices = np.array(indices)
            if len(indices.shape) == 1:
                indices = indices[None, :]
            i_pos = self.loc[indices[:, 0], coords].values
            b_pos = self.loc[indices[:, 1], coords].values
            a_pos = self.loc[indices[:, 2], coords].values
            d_pos = self.loc[indices[:, 3], coords].values

        IB = b_pos - i_pos
        BA = a_pos - b_pos
        AD = d_pos - a_pos

        N1 = np.cross(IB, BA, axis=1)
        N2 = np.cross(BA, AD, axis=1)
        n1, n2 = [v / np.linalg.norm(v, axis=1)[:, None] for v in (N1, N2)]

        dot_product = np.sum(n1 * n2, axis=1)
        dot_product[dot_product > 1] = 1
        dot_product[dot_product < -1] = -1
        dihedrals = np.degrees(np.arccos(dot_product))

        # the next lines are to test the direction of rotation.
        # is a dihedral really 90 or 270 degrees?
        # Equivalent to direction of rotation of dihedral
        where_to_modify = np.sum(BA * np.cross(n1, n2, axis=1), axis=1) > 0
        where_to_modify = np.nonzero(where_to_modify)[0]

        length = indices.shape[0] - start_row
        sign = np.full(length, 1, dtype='float64')
        to_add = np.full(length, 0, dtype='float64')
        sign[where_to_modify] = -1
        to_add[where_to_modify] = 360
        dihedrals = to_add + sign * dihedrals
        return dihedrals