# Calculate the unknown coordinates of a point $B (x_2,y_2)$ on a line with given distance from a known point $A(x_1,y_1)$

I have a line which represents a cross section. I have the coordinates of on its starting point. I need the coordinates of the end point of that cross section line. The distance between these two points is known. Is there some way to calculate it, or do I need some more information?

I want to calculate the unknown coordinates of end point $$B (x_2,y_2)$$ on a line with given distance from a known coordinates of starting point $$A(x_1,x_2)$$.

### Clarification

I have a cross section line AB with length of $$2800$$m. The start point $$A(x_1,y_1,z_1)$$ is known. $$z_1$$ is the bed elevation on point $$A$$. I need to calculate the coordinates at end point $$B(x_2,y_2)$$. Now there are two situations.

• Case 1: I have $$z_2$$ at point $$B$$ with me also.
• Case 2: I don't have $$z_2$$ on point $$B$$ with me.
• question is not clear. mind rephrasing it?
– MonK
Aug 26, 2014 at 9:49
• i have a line which represents a cross section. I have the coordinates of on its starting point. I need the coordinates of the end point of that cross section line. The distance between these two points is known. is there some way to calculate it, or do i need some more information?? Aug 26, 2014 at 9:54
• geometrical approach needs slop of the line Aug 26, 2014 at 10:01
• @ Vikram ok let me be more clear to my question. I have a cross section line AB with length of 2800m. The start point A(x1,y1,z1) is known.z1 is the bed elevation on point A. I need to calculate the coordinates at end point B(x2,y2). Now there are two situations. Case1: i have z2 at point B with me also. Case 2: i dont have z2 on point B with me. I need a formula suitbale for the solution of this problem. please help. Aug 26, 2014 at 10:50
• @ MonK let me be more clear to my question. I have a cross section line AB with length of 2800m. The start point A(x1,y1,z1) is known.z1 is the bed elevation on point A. I need to calculate the coordinates at end point B(x2,y2). Now there are two situations. Case1: i have z2 at point B with me also. Case 2: i dont have z2 on point B with me. I need a formula suitbale for the solution of this problem. please help Aug 26, 2014 at 11:03

Assuming no typo in what you wrote and that I properly understood (this does not seem to be sure according to the comments I received after my initial answer), if you have point $A$ $(x_1,x_2)$ and point $B$ $(x_2,y_2)$ the square of the distance is given by $$d^2=(x_1-x_2)^2+(x_2-y_2)^2$$

I am sure that you can take from here.

• 1 eqn, 2 unknowns, how? Aug 26, 2014 at 10:03
• @Vikram.As far as I understood, only $y_2$ is unknown. Aug 26, 2014 at 10:05
• Both $x_2,y_2$ are not known, infact the slope is unknown.
– MonK
Aug 26, 2014 at 10:06
• @MonK. Read the post again. The OP says that point $A(x_1,x_2)$ is known and that point $B(x_2,y_2)$ is unknown but the distance is known. I assumed no typo in the question. Cheers :-) Aug 26, 2014 at 10:09
• @ClaudeLeibovici, B can be at any elevation , if A is origin then B can be any one of the points on the circle with center at origin, you travel the given distance, but in which direction? Aug 26, 2014 at 10:11

Let $(d)$ be the given line through unknown point $A(x_1, y_1)$. Then the parametric of $d$ has form $$x=x_0+ta; \quad y=y_0+tb\quad (t\in\mathbb{R}),$$ where $(a, b)$ is the direction vector of $(d)$ and $(x_0, y_0)$ is the point on $(d)$. Let $d$ be the given distance from a known point $B(x_2, y_2)$ to $A$. Solving the equation $$(x_0+ta-x_2)^2+(y_0+tb-y_2)^2=d.$$ We have three cases:

Case 1. The equation has no solution

Thẹn the distance from known point $B(x_2, y_2)$ to $(d)$ is greater than $d$ and so there is no point $A(x_1, y_1)$ on the line $(d)$ satisfying the given conditions.

Case 2. The equation has one solution

Then substitute the solution $t^*$ to the parametric form of $(d)$ we can find unknown point $A(x_1, y_1)$. The finding point is the projection from known point $B(x_2, y_2)$ to the line $(d)$.

Case 3. The equation has two distinct solutions

Then the distance from known point $B(x_2, y_2)$ to $(d)$ is less than $d$ and there are two point $A_1, A_2$ satissfying the given conditions. Substitute the solutions $t_1, t_2$ to the parametric form of $(d)$ we can find two unknown point $A_1(x^1_1, y^1_1)$ and $A_2(x^2_1, y^2_1)$.