def lagrange_derivative(x: float, x0: float, x1: float, x2: float, y0: float, y1: float, y2: float) -> float:
    """
    Three point lagrange derivative.

    It computes the derivative of \\(x\\) based on three points:
    \\([(x_0, y_0), (x_1, y_1), (x_2, y_2)]\\)
    Depending od the value of \\(x\\), we can compute the forward,
    backward or central derivative.


    Args:
        x (float): the value where the derivative will be computed
        x0 (float): first x value
        x1 (float): second x value
        x2 (float): third x value
        y0 (float): first y value
        y1 (float): second y value
        y2 (float): third y value
    
    Returns:
        float: the first derivative for \\(x\\) value

    """
    p0 = y0 * (2*x-x1-x2) / ((x0-x1)*(x0-x2))
    p1 = y1 * (2*x-x0-x2) / ((x1-x0)*(x1-x2))
    p2 = y2 * (2*x-x0-x1) / ((x2-x0)*(x2-x1))
    return p0+p1+p2