Ecuația dreptei care trece prin două puncte A și B este:
[tex]\it \dfrac{y-y_A}{y_B-y_A}=\dfrac{x-x_A}{x_B-x_A}[/tex]
Pentru problema dată, avem ecuația:
[tex]\it \dfrac{y-(-1)}{2-(-1)}=\dfrac{x-2}{-1-2}\ \Rightarrow\ \dfrac{y+1}{2+1}=\dfrac{x-2}{-3}\ \Rightarrow\ \dfrac{y+1}{3}=\dfrac{-x+2}{3}\ \Rightarrow\\ \\ \\ \Rightarrow\ y+1=-x+2 \Rightarrow y=-x+2-1 \Rightarrow y=-x+1[/tex]