Get X and Y coordinates after adding d to the length of a line I wish to add d to the end of a straight line. I know the lines start and end point coordinates and its Y = aX + b formula. What I do for now is that I get the angle of this line to determine the distance traveled in both X and Y but I would like to try a different approach, for the sake of learning something.
Since I know the value of a, b and d, I figured I could isolate X starting from X² + (aX + b)² = d² but I realized that I was stuck there, not knowing how to get the X out of the parentheses.
Many of you may realize that I'm just average in math, but I'm here to elarn so I'd like to know how some of you may manage to isolate X and Y in such situations.
 A: Suppose that the line segment is between coordinates $P_0=(x_0,y_0)$ and $P_1=(x_1,y_1)$. Also, let the length of the segment be $D=P_0P_1=\sqrt{(x_1-x_0)^2+(y_1-y_0)^2}$.Then every point $(x,y)$ on the line through the points $P_0$ and $P_1$ satisfies the equation
$$P(t) = (x_0,y_0) + \dfrac tD(x_1-x_0, y_1-y_0).$$ 
In particular, $P(0) = (x_0,y_0)$ and $P(D)=(x_1,y_1).$
If you put a number line on the line $\overleftrightarrow{P_0P_1}$ with the number line coordinate of $P_0$ being $0$ and the number line coordinate of $P_1$ being $D$, then the function $P(t)$ gives you the $(x,y)-$coordinates of the point on the line $\overleftrightarrow{P_0P_1}$ with number line coordinate $t$.
So the point that adds a length of $d$ to your line segment would have coordinates $P(D+d)= (x_0,y_0) + \dfrac{D+d}{D}(x_1-x_0, y_1-y_0).$
A: Up vote for steven gregory.
Anyway, I'll try to give a similar (and maybe simpler) way.
If $P_1 = (x_1, y_1)$ is the ending point, you want to find another point, let's call it $P_2 = (x_2, y_2)$, which lays on the same line $y = ax + b$ and the distance between $P_1$ and $P_2$ is exactly $d$. To this aim, consider that:
$$y_2 = a x_2 + b.$$
The square distance between $P_1$ and $P_2$ is the following:
$$\overline{P_1P_2}^2 = (x_1-x_2)^2 + (y_1-y_2)^2 = \\
= (x_1 - x_2)^2 + (y_1 - ax_2 - b)^2 = d^2.$$
Developing this, you get a second order equation in $x_2$:
$$(a^2+1)x_2^2 + [2a(b-y_1)-2x_1]x_2 + x_1^2-d^2+(b-y_1)^2 = 0.$$
Solving this, you will get two solutions. If you assume that $x_2$ is bigger than $x_1$, then you must select only the solution bigger than $x_1$.

Example
$a = 2, b = -1, x_1 = 1, y_1 = 1, d = 1$
The equation you get is:
$$5x_2^2 - 10x_2 + 4 = 0.$$
The solutions are:
$$\begin{cases}
x_2 = 1 + \frac{\sqrt{5}}{5}\\
x_2 = 1 - \frac{\sqrt{5}}{5}\\
\end{cases}$$
You will keep only the first one which is bigger than $x_1 = 1$. Thereafter,
$$y_2 = ax_2 + b = 2\left(1 + \frac{\sqrt{5}}{5}\right)-1 = 1 + 2\frac{\sqrt{5}}{5}.$$
Concluding, the point $P_2$ is:
$$P_2 = \left(1 + \frac{\sqrt{5}}{5}, 1 + 2\frac{\sqrt{5}}{5}\right).$$
