How to calculate the side of a right triangle from the coordinates of points and the length of one side?
I have the line AB. And I need to calculate the coordinates of point D.
I know the coordinates of points A, B and C.
If I make this an imaginary right triangle, I just need to know the length of the CD line (a in the picture)
Since I can easily calculate the line length AC (d on the picture) from the coordinates, I only need the line AD to calculate the CD using the Pythagorean theorem.
I know the coordinates of points A and B, so I can easily calculate the length of line AB from this.
But how do I calculate the length of the AD line so that I can then calculate the length of the CD? Or is it possible in another way? Unfortunately, I don't know the angles either.
Please help
Thank you
Solution 1:
Let $t$ the $y$ coordinate of poinr $D$. We have by simili relations that: $$\frac{\sqrt{(x_4-x_2)^2+(t-y_2)^2}}{\sqrt{(x_1-x_4)^2+(y_1-t)^2}}=\frac{|y_3-t|}{|t-y_2|}$$ Now, you can notice that putting $O(0,0)$ on the point $A$, the points $D$ and $C$ have the same $x$ coordinate. And the equation becomes:
$$\frac{\sqrt{(x_3-x_2)^2+(t-y_2)^2}}{\sqrt{(x_1-x_3)^2+(y_1-t)^2}}=\frac{|y_3-t|}{|t-y_2|}$$
Can you finish it from here?
Solution 2:
Hint: Obtain the equation of the line (say $L$) passing through $C$ and perpendicular to the line $AC$. Calculate the point of intersection of $L$ and the line $AB$. This should give you the coordinates of $D$. In other words, if $D$ has the coordinates $(x_4,y_4)$, then you have the following constraints:
- $(x_1-x_3)(x_4-x_3)+(y_1-y_3)(y_4-y_3)=0$. (Because $AC$ is perpendicular to $CD$)
- $\frac{y_4-y_2}{y_2-y_1}=\frac{x_4-x_2}{x_2-x_1}$ (Because $D$ lies on $AB$. The cases where $x_1=x_2$ and/or $y_1=y_2$ can be dealt with similarly)
These can be solved to obtain $x_4,y_4$