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 two points, $p_1$ and $p_2$, in a cartesian plane, and a fixed radius, $r$.

I want to find the coordinates of another point, $p_3$, that is in the same line of the $p_1$ and $p_2$, and always in a fixed distance, $r$, from the point $p_1$.

$(a,b)$       $(?,?)$                      $\quad \quad \quad\space(c,d)$
$p_1$---------$p_3$---------------------$p_2$
        $\quad r$

Considering that the points $p_1$ and $p_2$ can be on anywhere in the plane.

Thanks in advance.

share|improve this question

4 Answers 4

up vote 1 down vote accepted

This is the problem of finding the point $p_3$$ (x,y)$ that divides the the joint of two points $p_1 (a,b)$ and $p_2 (c,d)$ internally in the ratio $r:t\normalsize$ (i.e. $p_1p_3:p_3p_1 = r:t$)

First you have to find the value of the consequent of the ratio i.e $t$, for that find the distance of $p_1p_2$ using this distance formula and then subtract $r$ from it.

Thus, $$ t = \left(\sqrt{ (c - a)^2 + (d-b)^2 } \right) -r $$

Now you can find $$ x= \frac{rc + ta}{r+t}$$ and $$ y=\frac{rd + tb}{r+t}$$

share|improve this answer
    
The denominator should be just $t$ –  Tapu Nov 25 '11 at 19:08
    
Sorry, I have removed the down vote now...plz edit your post :) –  Tapu Nov 25 '11 at 19:12
    
@Swapan: Fixed. –  Quixotic Nov 25 '11 at 19:14

Do you mean $$ p_1+r\frac{p_2-p_1}{|p_2-p_1|} $$ Afterthought:

If you're not worried about being on the line segment between $p_1$ and $p_2$, then $$ p_1-r\frac{p_2-p_1}{|p_2-p_1|} $$ works also.

share|improve this answer
    
This is on the line between $p_1$ and $p_2$ as long as $|p_2-p_1|\ge r$. –  robjohn Nov 25 '11 at 18:34

Let's define point $P_3$ as $P_3(e,f)$ .

You may calculate coordinates $e$ and $f$ using following equalities :

$e=\frac{a+\lambda c}{1+\lambda}$ , and $f= \frac{b+\lambda d}{1+\lambda}$

where $\lambda=\frac{r}{|P_1P_2|-r}$ , and $|P_1P_2|=\sqrt{(a-c)^2+(b-d)^2}$

share|improve this answer

Are you sure $P_3$ lies inside the segment $P_1P_2$? This means $r\le \sqrt{(a-c)^2+(b-d)^2}$. In this case the point $P_3$ is given by $$\left(\frac{a \times (\sqrt{(a-c)^2+(b-d)^2}-r)+c \times r }{\sqrt{(a-c)^2+(b-d)^2}},\frac{b \times (\sqrt{(a-c)^2+(b-d)^2}-r)+d \times r}{\sqrt{(a-c)^2+(b-d)^2}}\right)$$

share|improve this answer
    
are you sure about the denominator? –  Quixotic Nov 25 '11 at 18:56
    
@MaX You may wish to edit your answer once more to correct present $t$ to $t-r$, or to put the denominator as just $t$ :) –  Tapu Nov 25 '11 at 19:06
    
@MaX No problem....but please be patient, I never argue (and sometime bet) without being sure that "If you can prove me false, it will imply 0=1" :D –  Tapu Nov 25 '11 at 19:15

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.