Here's another method, using similarity. Consider the following diagram:
View attachment 3095
We know then that:
\(\displaystyle \dfrac{\left|y-y_1 \right|}{m}=\dfrac{\left|x_1-x_2 \right|}{n}\)
\(\displaystyle \left|y-y_1 \right|=\dfrac{m}{n}\left|x_1-x_2 \right|\)
\(\displaystyle y-y_1=\pm\dfrac{m}{n}\left(x_1-x_2 \right)\)
\(\displaystyle y=y_1\pm\dfrac{m}{n}\left(x_1-x_2 \right)\)
and:
\(\displaystyle \dfrac{\left|x-x_1 \right|}{m}=\dfrac{\left|y_2-y_1 \right|}{n}\)
\(\displaystyle \left|x-x_1 \right|=\dfrac{m}{n}\left|y_2-y_1 \right|\)
\(\displaystyle x-x_1=\pm\dfrac{m}{n}\left(y_2-y_1 \right)\)
\(\displaystyle x=x_1\pm\dfrac{m}{n}\left(y_2-y_1 \right)\)
And so we have:
\(\displaystyle (x,y)=\left(x_1\pm\dfrac{m\left(y_2-y_1 \right)}{n},y_1\pm\dfrac{m\left(x_1-x_2 \right)}{n} \right)\)