# Distance of a point (inside) circle with arbitrary direction

For a circle with radius $$r$$ centered at point $$A \equiv (x_a, y_a)$$,

How to calculate distance CM in, a given arbitrary direction

$$d \equiv (d_x, d_y) \leftarrow \|d\|_2 = 1.0$$

for a point $$C \equiv (C_x, C_y)$$ inside the circle and a point on the Circle $$M$$ (see figure below)

• Are you given point $C$ and some angle $\theta$ and need to find $M$? – Daniel Mathias Dec 28 '18 at 13:41

The parametric equation of line $$CM$$ is $$(x,y)=(C_x+d_x\,t,C_y+d_y\,t).$$ Substitute these coordinates into the equation of the circle $$(x-x_a)^2+(y-y_a)^2=r^2$$ to get the values of $$t$$ giving the intersections. Of course you'll get two solutions for $$t$$: if you want only the intersection of the circle with the ray starting at $$C$$ with direction $$d$$, then you must keep only the positive solution.