# Find the point of a circumference following the line from center to a point in the circle

The purple circle dignifies a known center point. If I choose a point at random inside the circle, is it possible find the orange square (The point where the green line intersects with the circumference)?

The only known values are:

• The center of the circle (Lets call it $x_0$ and $y_0$)
• The radius of the circle ($r$)
• The coordinates of the random point in the circle ($x_1$ and $y_1$, pointed by the red circle)

-

If $z_0$ is the center, $z \neq z_0$ is the random point, and $r$ is the radius, then $z_0 + r(z-z_0)/|z-z_0|$ is the desired point, isn't it?
If you want to stick to 2 real coordinates instead of one complex number, that's the same as $$\left( x_0 + \frac{r(x-x_0)}{\sqrt{(x-x_0)^2 + (y-y_0)^2}}, y_0 + \frac{r(y-y_0)}{\sqrt{(x-x_0)^2 + (y-y_0)^2}}\right)$$
To see why this works, note that if the center of the circle were already at the origin, we would just need to divide the coordinates of the red point by its distance from the origin (sliding along the line to the unit circle), then multiply its coordinates by $r$ (sliding it again along the line to the target circle). To overcome this difficulty, just translate to the desired location (subtract $z_0$), do the work there (divide by the distance of the translated point $z-z_0$ to the origin, which is $|z-z_0|$, and multiply by $r$), then translate back to the original location (add $z_0$). That's exactly each piece of the formula.