Given the graph of a function, write its analytic expression

Given the graph of a function, write its analytic expression

It can be seen from the graph of a function that the graph passes through (1,0), (0, - 2) points. Let the analytic formula of a function be y = KX + B (K ≠ 0). Substituting (1,0), (0, - 2) points, we can get K + B = 0b = - 2, and the solution is k = 2B = - 2. Therefore, the analytic formula of a function is y = 2x-2