I have the x,y coordinates of point A, point B, the distance AB, the distance BC, and the angle at B, which is more than 90 degrees. How do I calculate point C?
It's been years since varsity, so my math is very rusty. Please do not assume much :-)
I have the x,y coordinates of point A, point B, the distance AB, the distance BC, and the angle at B, which is more than 90 degrees. How do I calculate point C?
It's been years since varsity, so my math is very rusty. Please do not assume much :-)
On
First, use cosine theorem to find $AC$. $AC^2=AB^2+BC^2-2AB\cdot BC\cdot \cos B$.
Let $AC=b$, $AB=c$, $BC=a$ and points have coordinates $A(x_A, y_A)$, $B (x_B, y_B), C (x_C, Y_C)$. Then we have this system of equations to find coordinates of point $C$:
\begin{cases}
(x_C-x_B)^2+(y_C-y_B)^2=a^2 \\
(x_C-x_A)^2+(y_C-y_A)^2=b^2
\end{cases}
We have two unknowns $x_C$ and $y_C$ and two equations.
Basically, what we are doing here is drawing two circles, one has $A$ as center and radius $AC$ and the other one has $B$ as a center and radius $BC$. Point $C$ will be the intersection of these circles. Be aware that you will find two solutions as $C$ has two possible locations based on the information.
Solving the system: \begin{cases} x_C^2-2x_B x_C+x_B^2+y_C^2-2 y_B y_C+y_B^2=a^2 \\ x_C^2-2x_Ax_C+x_A^2+y_C^2-2y_Ay_C+y_A^2=b^2 \end{cases}
Subtracting second equation from the first: \begin{cases} x_C(2x_A-2x_B)+y_C(2y_A-2y_B)=a^2-b^2+x_A^2+y_A^2-x_B^2-y_B^2 \\ x_C^2-2x_Ax_C+x_A^2+y_C^2-2y_Ay_C+y_A^2=b^2 \end{cases}
Expressing $x_C$ in terms of $y_C$:
\begin{cases} x_C=\frac{a^2-b^2+x_A^2+y_A^2-x_B^2-y_B^2-y_C(2y_A-2y_B)}{2x_A-2x_B} \\ x_C^2-2x_Ax_C+x_A^2+y_C^2-2y_Ay_C+y_A^2=b^2 \end{cases}
All that's left is to substitute $x_C$ in the second equation and we'll get a quadratic equation with one unknown $y_C$.
You can use vectors to find the position of $C$ relative to the point $A$. So it will suffice if you can calculate the vector $\vec{AC}$.