4
$\begingroup$

I have two points, approximately we take values for that:

Point $A = (50, 150)$; Point $B = (150, 50)$;

So the distance should be calculated here, $\text{distance} = \sqrt{(B_x - A_x)(B_x - A_x) + (B_y - A_y)(B_y - A_y)}$;

Now I want any one poins which is far from Second point B at specific distance (Example, 10).

            B(x,y)
           /
          /
         C(x,y)
        /
       /
      /
     /
    /  
   /
  A(x,y)

Point c on Line Segment and its specific distance from point B(Ex, 10)..

Which formula would be better to calculate C point here ?

Please help me about that.

$\endgroup$
  • $\begingroup$ thanks Gigili, hey how could write this Sqrt in mathematics looks, let know also these types of tools, plz.. $\endgroup$ – Solid Soft Jun 8 '12 at 8:05
  • $\begingroup$ I think he wants the 2nd component to be 10. $\endgroup$ – copper.hat Jun 8 '12 at 8:09
  • $\begingroup$ Point c on Line Segment and its specific distance from point B.. let me update question.. Thanks.. $\endgroup$ – Solid Soft Jun 8 '12 at 8:09
  • $\begingroup$ Its specific distance from second Point B, for an example it may be 10. $\endgroup$ – Solid Soft Jun 8 '12 at 9:09
  • $\begingroup$ Ohh god, 10 is not a distance of the two points, i write 10 only for example, that 10 is the distance of point C from point B. $\endgroup$ – Solid Soft Jun 8 '12 at 9:34
2
$\begingroup$

This what I come up with:

Find $(x_0,y_0)$ so that $10 = \sqrt{(50 - y_0)^2 + (150 - x_0)^2}$ and $(x_0,y_0)$ also lies on the line $y = 200 - x$.

Since $(x_0,y_0)$ lies on that line, we can write $y_0 = 200 - x_0$, so the distance formula becomes:

$10 = \sqrt{(-150 + x_0)^2 + (150 - x_0)^2} = \pm\sqrt{2}(x_0 - 150)$

Thus $x_0 = 150 \pm \frac{10}{\sqrt{2}}$, leading to:

$y_0 = 50 \mp \frac{10}{\sqrt{2}}$

$\endgroup$
  • $\begingroup$ What's $(x_0, y_0)$ ? $\endgroup$ – Solid Soft Jun 8 '12 at 9:35
  • $\begingroup$ The x and y coordinates of the point "C" you're looking for. $\endgroup$ – David Wheeler Jun 8 '12 at 9:35
1
$\begingroup$

I hope I have understood your question.

The general form of the line is $\lambda A + (1-\lambda) B$. You wish to find $\lambda$ so that the $y$-component is $10$.

Expanding gives: $\lambda A + (1-\lambda) B = (150-100 \lambda, 50+100 \lambda)$. Equating the $2$nd component to $10$ and solving for $\lambda$ gives $\lambda = -0.4$, from which we get the point $(190,10)$.

I think I misunderstood your question. If you wish to find points on the line at a specific distance $\delta$ from $B$, then you need to find the $\lambda$ that satisfies $||\lambda A + (1-\lambda) B -B || = |\lambda|\,||A-B|| = \delta$. Specifically, this gives $\lambda = \pm \frac{\delta}{||A-B||}$.

In this case, you have $\delta = 10$, and $||A-B|| = 100 \sqrt{2}$, so $\lambda = \pm \frac{1}{10\sqrt{2}}$. Substituting the positive value (which corresponds to the point between $A$ and $B$) in gives:

$$\lambda A + (1-\lambda) B = (150-\frac{10}{\sqrt{2}}, 50+\frac{10}{\sqrt{2}}).$$

The general formula for a point $\delta$ away from $B$ will be, of course:

$$(x,y) = (150\pm\frac{\delta}{\sqrt{2}}, 50 \mp\frac{\delta}{\sqrt{2}}).$$

$\endgroup$
  • $\begingroup$ So (110, 10) point will be "C" right ? $\endgroup$ – Solid Soft Jun 8 '12 at 9:25
  • $\begingroup$ That point does not lie on the line connecting A and B. $\endgroup$ – David Wheeler Jun 8 '12 at 9:33
  • $\begingroup$ It is on the line through $A$ and $B$. If the y-component is $10$, there is little choice here. $\endgroup$ – copper.hat Jun 8 '12 at 15:13
  • $\begingroup$ The line through $A$ and $B$ has equation $y=200-x$. The point $(110,10)$ clearly fails to satisfy this equation. You should have $150-100(-0.4)=150+40=190$. Also, I believe that the OP wishes a point between $A,B$ having a specified distance from $B$--for example, $10$. The OP's abbreviation "(Ex., $10$)" is perhaps the cause of confusion. $\endgroup$ – Cameron Buie Jun 8 '12 at 16:00
  • $\begingroup$ It was an arithmetic error. I used $+0.4$ by mistake. I have fixed it. $\endgroup$ – copper.hat Jun 8 '12 at 16:02
0
$\begingroup$

Another easy to understand solution using vector arithmetic:

$$ \vec{a} = \begin{pmatrix}50\\150\end{pmatrix}, \vec{b}= \begin{pmatrix}150\\50\end{pmatrix} $$

Calculate direction vector $\vec{d}$ (the normalized distance vector between a and b):

$$ \vec{d} = \frac{\vec{a} - \vec{b}}{|\vec{a} - \vec{b}|} $$

$\vec{d}$ has length 1 now. So to place a point $\vec{c}$ between $\vec{a}$ and $\vec{b}$ at a distance $x$ from $\vec{b}$, simply do:

$$ \vec{c} = \vec{b} + x \vec{d} $$

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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