Best way to find the Coordinates of a Point on a Line-Segment a specified Distance Away from another Point 
I have 4 points: $Q, R, S, T$.
I know the following


*

*Coordinates for $R$, $T$, and $S$;

*Length of $\overline{RQ}$

*That segment $\overline{RT} < \overline{RQ} < \overline{RS}$;

*I need to figure out the coordinates of $Q$.


$R$, $T$, $S$ form a triangle and point $Q$ can be found on the line segment $\overline{TS}$. I need to get the coordinates for $Q$.
I have solutions for this problem, but they are all so convoluted and long I know I must be doing something wrong. I feel certain there must a simple elegant way to solve this. The best solution would be the simplest one since this needs to be programmed.
 A: This is the problem of finding the intersection of a straight line and a
circle, as commented by J.M.. The more elementary method
using analytical geometry, without rotate or translate the coordinate
axes (which would make the computation easier$^1$), although not being a compact one, is the following (see sketch). 

The equation defined by points $
S(N,J)$ and $T(M,I)$ is given by
$$
y-J=m(x-N),\qquad m=\frac{I-J}{M-N}\tag{1}.
$$
The equation of the circle centered at $R$ with radius $d=\overline{RQ}$ is
$$
(x-L)^{2}+(y-H)^{2}=d^{2}.\tag{2}
$$
You need to solve the following system
$$
\left\{ 
\begin{array}{c}
y-J=m(x-N) \\ 
(x-L)^{2}+(y-H)^{2}=d^{2},
\end{array}\tag{3}
\right. 
$$
which is equivalent to
$$
\left\{ 
\begin{array}{c}
x=\frac{y-J+mN}{m} \\ 
\left(\frac{y-J+mN}{m}-L\right)^{2}+(y-H)^{2}=d^{2}.\tag{4}
\end{array}
\right. 
$$
Solving the quadratic equation yields (with the help of SWP):
$$
y=\frac{1}{ m^{2}+1 }\left( -mN+Lm+J+m^{2}H\pm \sqrt{\Delta}\right), \tag{5}
$$
where the discriminant is
$$\begin{eqnarray*}
\Delta &=&A+B, \\ \text{with  }
A
&=&-m^{4}N^{2}+m^{4}d^{2}-m^{4}L^{2}-m^{2}J^{2}-m^{2}H^{2}+d^{2}m^{2}-2m^{3}NH,
\\
B &=&2Lm^{3}H+2Jm^{2}H+2m^{4}NL-2m^{3}JL+2m^{3}JN.\tag{6}
\end{eqnarray*}$$
The information $\overline{RT}<\overline{RQ}<\overline{RS}$ will define the
signal of the term $ \pm \sqrt{\Delta}$. The coordinates of $Q$ are $O=x,K=y$.

$^1$By making the translation $X=x-L$ and $Y=y-H$, and computing the new coordinates of the points in this $X,Y$ system, the above formulae simplify
(it is equivalent to set $L=H=0$ in them). In the end they should be convert back to the original $x,y$ system.
A: I suppose that the distance $d$ is known because it is mentioned in the title. The point $Q$ is the intersection of the circe with the radius $d$ around $R$ and the line $TS$.
Circle:
$$(X - R)^2 = d^2$$
Line $TS$:
$$ X(t) = (T-S) t + S$$
Intersection (exists since $\overline{RT} < \overline{RQ} < \overline{RS}$):
$$(T-S)^2 t^2 + 2(T-S) \cdot (S-R) t + (S-R)^2 = d^2$$
Here, $T-S$ etc. are the vectors given by subtracting the respective point coordinates, '$\cdot$' means the scalar product, and the power 2 of a vector is its squared length. Solve this quadratic equation for $t$ yielding at most two solutions $t_1, t_2$. Since the parameter $t$ corresponds to the position of $Q$ at the line segment $TS$, take that $t_i$ for which $0 \le t_i \le 1$. Then $Q = X(t_i)$.
A: Let $d$ be the length $RQ$.  Solve $(tM+(1-t)N-L)^2 + (tI+(1-t)J-H)^2 = d^2$ for $t$.   As a quadratic this will give two solutions.  If $ RT < RQ < RS$ then one of these solutions will be between $0$ and $1$, so pick that one. 
Then the co-ordinates of $Q$ are $(O,K)=(tM+(1-t)N,tI+(1-t)J)$. 
A: since you know Coordinates for R, T, and S
so you know the equation of line ST.
so you can write Coordinates of point Q in terms of a variable say x (x coordinates is x and y coordinates in terms of x using equation of ST.
Now just apply distance formula for Lenght of QR as you know the length of QR and now u have x and hence you have coordinate of Q.
