I have points $(x_1, y_1)$ and $(x_2, y_2)$ on a line. I need to calculate the point $(x_3, y_3)$ which is some distance $d$ away from $(x_1, y_1)$ . I had calculated the slope using the formula, $$ m = \frac{y_2-y_1}{x_2-x_1} $$ where $m$ is the slope
Then I used the slope to calculate the angle $\theta = \arctan(m)$. With the angle and start and end points I used the following formula to calculate the coordinates of the point $(x_3, y_3)$ $$ \begin{split} x_3 &= x_2 + d\sin \theta\\ y_3 &= y_2 + d\cos \theta \end{split} $$ I tried to plot the point I obtained. However, the angle of the new line always seems wrong and I am not sure where I am making the mistake, slope or the angle formula? This is the line generated after the calculations, the $(x_3, y_3)$ seems to be with completely wrong angles.