First, we check that the three points are collinear.
Given three points (x1,y1), (x2,y2), and (x3,y3), then the three points are collinear if the following condition is satisfied.
![(y_2-y_1)/(x_2-x_1)=(y_3-y_1)/(x_3-x_1)](https://img.qammunity.org/2023/formulas/mathematics/college/1xhahula1o9gbgye1l0nrlvn99w3hhj549.png)
In our case, we can set
(x1,y1) =(-2,0), (x2,y2) = ( 4, 18)and (x3,y3) = (5, 21)
![\begin{gathered} \text{ Then, we have} \\ (y_2-y_1)/(x_2-x_1)=(18-0)/(4-(-2))=(18)/(4+2)=(18)/(6)=3 \end{gathered}](https://img.qammunity.org/2023/formulas/mathematics/college/9gfjs7p1zfesowp21hwlqiiyu8221vqp1l.png)
And
![(y_3-y_1)/(x_3-x_1)=(21-0)/(5-(-2))=(21)/(5+2)=(21)/(7)=3](https://img.qammunity.org/2023/formulas/mathematics/college/16413wyfx5psb2znmpblvx2r3ok2g92g67.png)
Hence
![(y_2-y_1)/(x_2-x_1)=(y_3-y_1)/(x_3-x_1)](https://img.qammunity.org/2023/formulas/mathematics/college/1xhahula1o9gbgye1l0nrlvn99w3hhj549.png)
Therefore, the points (-2,0), ( 4, 18), and (5, 21) are collinear.
Given two points (x1,y1) and (x2,y2) on the Cartesian plane, then the gradient, m, of the line that passes through them is given by
![m=(y_2-y_1)/(x_2-x_1)](https://img.qammunity.org/2023/formulas/mathematics/high-school/78uaqhwt0aws3qfwxigaftpihnmb1gzxtp.png)
Then, the gradient of the line passing through (-2,0), ( 4, 18) is 3
Given a point (x1,y1) on the Cartesian plane, and a line that passes through the point with gradient, m, then the equation of the line is given by
![y-y_1=m(x-x_1)](https://img.qammunity.org/2023/formulas/mathematics/high-school/csobd57zth7rh9k4hz9amldzpq2owf0z4j.png)
Therefore,
![y-0=3(x-(-2)=3(x+2)](https://img.qammunity.org/2023/formulas/mathematics/college/tngd8t22zkeyip5zlzovqrqt026z3cna80.png)
That is the equation is
![y=3x+6](https://img.qammunity.org/2023/formulas/mathematics/high-school/ukad9voog4cbkjrvqw60mc1okqee2ba7n7.png)