Calculate coordinates of third point in a triangle (2D) knowing 2 points coordinates

48 Views Asked by At

Triangle

I have 2 points v1 and v2. I have a length B. I can work out length A and therefore C if necessary. My aim is to find the coordinates of v3. I have tried a few different ideas but can't get the correct solution. Any ideas? Thank you.

Solution1

enter image description here

2

There are 2 best solutions below

1
On BEST ANSWER

Your solution is almost correct, except the definitions of $T$ and $Q$ (they should be the other way around). This is because alpha is the angle between the vertical and $B$. To check, use $V_1=(0,0)$ and $V_2=(3,0)$. The final coordinates have to be $(3,3)$. From programming point of view, use np.atan2 instead. Then you don't need to calculate $A$. Also, note that you can go in the other direction as well ($V_3$ could be the other side of the $V_1 V_2$ line)

0
On

The unit vector parallel to edge $v_1v_2$ is given by $\displaystyle\hat n=\frac{\vec v_2-\vec v_1}{|\vec v_2-\vec v_1|}=(\alpha,\beta)$. The direction ratios of the unit vector perpendicular to $\hat n$ is given by $\hat m=(\pm\beta,\mp\alpha)$. The position vector of vertex $v_3,\vec v_3=\vec v_2+B\hat m$. Note that there are two answers for $\vec v_3$.