def gradientDeterminant(reach_list, y, w):
    """ Calculate the gradient determinant between two vectors. 
    
    Arguments:
        reach_list: [ndarray] 1D numpy array containing reachability distance values of individual data points
        y: [int] index of the point for which the gradient is calculated
        w: [float] distance between data points in the reachability plot

    Returns:
        [float] gradient determinant of the given point (see source paper for more information)

    """

    # Get reachabilities of the previous, current and the next point
    x_r = reach_list[y - 1]
    y_r = reach_list[y]
    z_r = reach_list[y + 1]

    return w*(y_r-x_r) - w*(z_r-y_r)