Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I have the following representation: enter image description here - line pass through the centers of the circles

I have to find the coordinates of the points of intersection of the line with circles (4 points). From these 4 points I have to choose 2 points , so that the distance between them to be minimal .

If I denote the coordinates of the center of the circle with $x_a,y_a$ (respectively ,$x_b,y_b$) and radius with $r_a$ , $(r_b)$ I have the following:

$(x+x_a)^2+(y+y_a)^2=r_a^2$ (circle A)

$(x+x_b)^2+(y+y_b)^2=r_b^2$(circle B)

$(x-x_a)/(x_b-x_a)=(y-y_a)/(y_b-y_a) $(line)

Computing the system with WolframAlpha I got some bulky answers.

Is there any trick to ease the solving of the system ? Thanks in advance.

share|improve this question
    
I'm not sure I understand your question; there seem to be only 2 points of intersection between the circles and the line. –  recursive recursion Mar 10 at 19:25

1 Answer 1

up vote 1 down vote accepted

You can approach this I think quite simply using just vectors. You are given $x_a$, $y_a$, and $r_a$, as well as $x_b$, $y_b$ and $r_b$. Let $a = \begin{bmatrix} x_a \\ y_a \end{bmatrix}$, and similarly $b = \begin{bmatrix} x_b \\ y_b \end{bmatrix}$. The unit vector from $A$ toward $B$ is given by $$ v_{ab} = \frac{b-a}{|b-a|} $$ Then your four points are simply $$ a \pm r_a v_{ab} $$ and $$ b \pm r_b v_{ab} $$

share|improve this answer
    
Brilliant solution , thank you very much ! –  Liviu Solcovenco Mar 10 at 20:52

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.