Calculate last point in triangle

148 Views Asked by At

I'm trying to find the last point in a triangle like this below enter image description here

I know what $X1,Y1$ and $X2,Y2$ is. Now i need to Find $X3,Y3$ which should lay at a angle of $45°$ from $X2,Y2$

I can get the length between $X1Y1$ And $X2,Y2$ If needed.

I know this should be a simple matter, but i just can't find the right way to do it. And by searching online, i only found some high level math, i could not follow. So please bare with me, an explain how this can be done, for stupid me.

2

There are 2 best solutions below

7
On BEST ANSWER

Using complex numbers

\begin{align*} \frac{z_3-z_1}{z_2-z_1} &= \operatorname{cis} \frac{\pi}{4} \\ &= \frac{1+i}{\sqrt{2}} \\ z_3 &= z_1+\frac{(1+i)(z_2-z_1)}{\sqrt{2}} \\ x_3+y_3 i &= x_1+y_1 i+\frac{1+i}{\sqrt{2}} [(x_2-x_1)+(y_2-y_1)i] \\ &= \left( x_1+\frac{x_2-x_1+y_1-y_2}{\sqrt{2}} \right)+ \left( y_1+\frac{x_2-x_1+y_2-y_1}{\sqrt{2}} \right)i \\ \begin{pmatrix} x_3 \\ y_3 \end{pmatrix} &= \begin{pmatrix} x_1+\frac{x_2-x_1+y_1-y_2}{\sqrt{2}} \\ y_1+\frac{x_2-x_1+y_2-y_1}{\sqrt{2}} \end{pmatrix} \end{align*}

Only with elementary backgrounds

Let $A=(x_1,y_1)$, $B=(x_2,y_2)$, then

$$C=(x_2+y_1-y_2 ,\, y_2+x_2-x_1)$$

Note that $$AD : DC = 1: \sqrt{2}-1$$

By section formula

\begin{align*} D &= \frac{C+(\sqrt{2}-1)A}{1+(\sqrt{2}-1)} \\ &= \frac{(x_2+y_1-y_2 ,\, y_2+x_2-x_1)+(\sqrt{2}-1)(x_1 ,\, y_1)} {\sqrt{2}} \\ (x_3, y_3) &= \left( x_1+\frac{x_2-x_1+y_1-y_2}{\sqrt{2}} ,\, y_1+\frac{x_2-x_1+y_2-y_1}{\sqrt{2}} \right) \end{align*}

enter image description here

3
On
1968054   

$x_3=x_1+\frac{(x_2+y_1-x_1-y_2)\sqrt2}2$
$y_3=y_1+\frac{(x_2+y_2-x_1-y_1)\sqrt2}2$

I derived these from the following formulæ:
$\left\{\begin{matrix} X=\frac{(x_2-x_1)(x-x_1)+(y_2-y_1)(y-y_1)}{(x_2-x_1)^2+(y_2-y_1)^2}\\ Y=\frac{-(y_2-y_1)(x-x_1)+(x_2-x_1)(y-y_1)}{(x_2-x_1)^2+(y_2-y_1)^2} \end{matrix}\right.$
These map $(x_1\mid y_1)\text{ onto }(0\mid 0)\text{, }$
$(x_2\mid y_2)\text{ onto }(1\mid 0)\text{ and other points accordingly.}$

$\left\{\begin{matrix} x=(x_2-x_1)X-(y_2-y_1)Y+x_1\\ y=(y_2-y_1)X+(x_2-x_1)Y+y_1 \end{matrix}\right.$
These reverse the mapping.