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.

  • 0
    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.2012-06-08

3 Answers 3

2

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}}$

  • 0
    The x and y coordinates of the point "C" you're looking for.2012-06-08
1

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}}).$

  • 0
    Now t$h$at it is correct, I find t$h$e use of the "affine definition" of a line to be kinda nifty. +1.2012-06-15
0

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} $