Distance of a point (inside) circle with arbitrary direction

347 Views Asked by At

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)

Distance Problem

1

There are 1 best solutions below

0
On

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.