# How to know a point between two points?

Given two points $p_1 = (x_1, y_1)$, $p_2 = (x_2, y_2)$ and $R$ the distance between point $p_1$ and point $p_3$ on the line from point $p_1$ and point $p_2$.

Find the coordinates of point $p_3$.

Let $d = \overline{p_1p_2} = \sqrt{(x_2-x_1)^2 + (y_2-y_1)^2}$, and $p_3 = (x_3, y_3)$, then with the property of the similar triangle, we get

$\frac{R}{d} = \frac{x_3-x_1}{x_2-x_1} = \frac{y_3-y_1}{y_2-y_1}$

Solve the function and we can get the coordinates of $p_3$.

So we have the two points which means we can construct a line with slope

$m=\frac {y_{1}-y_{2}}{x_{1}-x_{2}}$

Which means it has the angle of inclination

$\theta=\arctan {\frac {y_{1}-y_{2}}{x_{1}-x_{2}}}$

Now in space we construct a triangle with hypotennuse $R$ and bottom angle bounded by the hypotennuse, $\theta$. So the coordinates of $p_3$ are

$p_3 = \left\{\begin{array}{ll} (x_1+R\cos (\theta), y_1+R\sin(\theta)) & : \theta < \pi \\ (x_1+R\cos (\pi-\theta), y_1+R\sin(\pi-\theta)) & : \theta > \pi \end{array} \right.$