How to calculate the third Point if two points and all distances between the Points are available?

3.4k Views Asked by At

I have a triangle with 3 Points. The positions of two points are available. And also i know the distances between the three Points. How is it possible to calculate the position of the third point?

Picture

Available

  • Point A (the x and y coordinate)
  • Point B (the x and y coordinate)
  • AB (distance between Point A and Point B)
  • BC (distance between Point B and Point C)
  • AC (distance between Point A and Point C)

Unknown

  • Point C (the x and y coordinate)
2

There are 2 best solutions below

1
On

You know the following two identities: $$AC = \sqrt{(C_x-A_x)^2+(C_y-A_y)^2}\quad\quad(1)$$ $$BC = \sqrt{(C_x-B_x)^2+(C_y-B_y)^2}\quad\quad(2)$$ So you have two equations with two unknowns. You can solve using any method your familiar with. Here's the first few steps using substitution (to get you started).

Solve $(1)$ for $C_x$ to obtain:

$$ C_x=\sqrt{AC^2-(C_y-A_y)^2} +A_x\quad\quad(3)$$ (We ignored the minus square root option, why?)

Now plug $(3)$ into $(2)$ and solve for $C_y$. (This will give you a numeric answer for $C_y$, which you can then plug into $(3)$ to get a numeric answer for $C_x$, make sense?)

Aside: Note that we didn't use $AB$. Since we already know $A_x,A_y,B_x,$ and $B_y$, $AB$ doesn't give us any new information.

0
On

I don't know if you still need an explicit solution, but here is a method.

Let $AB = c, \, BC = a, \, CA = b$. Assume we know the coordinates of points $A$ and $B$ which means we know the vectors $\vec{OA}$ and $\vec{OB}$ where $O$ is the origin of your coordinate system.

Denote by $\alpha = \angle \, CAB$ and let $H$ be the orthogonal projection of vertex $C$ onto the edge $AB$. Then the altitude $CH$ is orthogonal to $AB$.

First, we calculate the length of the altitude $CH$ and the length of the segment $AH$ (the latter being the orthogonal projection of $AC$). By Heron's formula the area $S_{ABC}$ of the triangle is $$S(a,b,c) = \frac{1}{4}\, \sqrt{(a+b+c)(a+ b -c)(a-b+c)(-a+b+c)}$$ Alternatively, one can compute it as $$S(a,b,c) =S_{ABC} = \frac{1}{2} \,c \cdot CH$$ so $$CH = \frac{2 \, S(a,b,c)}{c} = \frac{\, \sqrt{(a+b+c)(a+ b -c)(a-b+c)(-a+b+c)}\,}{2\,c}$$
In the right triangle $ACH$ $$AH = AC \, \cos(\angle \, CAB) = b \, \cos(\angle \, CAB)$$ By the law of cosines for triangle $ABC$ $$\cos(\angle \, CAB) = \frac{c^2+b^2-a^2}{2cb}$$ so $$AH =\frac{c^2+b^2-a^2}{2c}$$ If one knows vector $\vec{AB}$ one can immediately find an (in fact a pair of opposite) orthogonal vector $\vec{AB^{\perp}}$. This can be done as follows: if $\vec{AB}$ has coordinates $(u,v)$ then $\vec{AB^{\perp}}$ has coordinates $(-v,u)$ or $(v,-u)$ (hence the two opposite vectors and thus two possible solutions). Therefore, finding the coordinates of the point $C$, which is the same as finding the coordinates of vector $\vec{OC}$, can be achieved by writing $$\vec{OC} = \vec{OA} + \vec{AH} + \vec{HC} = \vec{OA} + \frac{|AH|}{c} \, \vec{AB} + \frac{|CH|}{c}\, \vec{AB^{\perp}}$$ $$\vec{OC} = \vec{OA} + \left(\frac{c^2+b^2-a^2}{2c^2} \right)\vec{AB} + \frac{2 \, S(a,b,c)}{c^2}\,\, \vec{AB^{\perp}}$$ More explicitly, if the coordinates of $A$ are $(x_A,y_A)$ and the coordinates of $B$ are $(x_B,y_B)$, then $$\vec{AB} = (x_B - x_A, \,\, y_B - y_A)$$ and therefore $$\vec{AB^{\perp}} = (y_A - y_B, \,\, x_B - x_A)$$ or $\vec{AB^{\perp}} = (y_B - y_A, \,\, x_A - x_B)$. Then the coordinates $(x_C, \, y_C)$ of point $C$ are

\begin{align} x_C &= x_A + \left(\frac{c^2+b^2-a^2}{2c^2} \right) (x_B - x_A) + \epsilon \,\frac{2 \, S(a,b,c)}{c^2}\,\, (y_A - y_B)\\ y_C &= y_A + \left(\frac{c^2+b^2-a^2}{2c^2} \right) (y_B - y_A) + \epsilon \,\frac{2 \, S(a,b,c)}{c^2}\,\, (x_B - x_A) \end{align} where $\epsilon = 1$ or $-1$ and $$S(a,b,c) = \frac{1}{4}\, \sqrt{(a+b+c)(a+ b -c)(a-b+c)(-a+b+c)}$$

I hope you need this for a computer implementation, otherwise it is a bit heavy.