The below image is the situation:
In the above image, the coordinates of center O and point A, and the radius r are known, while the coordinate of point B is unknown. The only things we know about point B are that it is on the circle, and it is on the same line with center O and point A. Point A can be any point on the line and can only be between center O and point B. Then the question is, how to find the coordinate of B?
Thank you very much for your help!
In vector form, assuming $0 < d(O,A) \le r$, we have $$\vec{B}=\vec{O}+r\frac{\vec{OA}}{d(O,A)}$$ hence, letting $$(x_O,y_O),\;\;\;(x_A,y_A),\;\;\;(x_B,y_B)$$ denote the coordinates of $O,A,B$, respectively, we get \begin{align*} x_B&=x_O+\frac{r}{\sqrt{(x_A-x_O)^2 + (y_A-y_O)^2}}(x_A-x_O)\\[4pt] y_B&=y_O+\frac{r}{\sqrt{(x_A-x_O)^2 + (y_A-y_O)^2}}(y_A-y_O)\\[4pt] \end{align*}