I need to know the correct formula for the function

The points of the line can be found from the diagram, they are as follows.
(1,0) and (0,-2)
The equation of line joining two points is
[tex]y-y_1=m(x-x_{1)}[/tex]Where m is the slope here.
The slope of the line is
[tex]m=\frac{-2}{-1}=2[/tex]Hence the equation is
[tex]y=2(x-1)[/tex]And the answer is y=2x-2.