TITLE: Determining the angle formed between the hypotenuses of two right triangles
QUESTION [0 upvotes]: I have two right triangles with legs $Ax, Az, Bx, Bz$. I am trying to determine $\theta$, given $Ax, Az, Bx$, and $Bz$. Have been working on a solution but finding myself going in circles.

REPLY [0 votes]: If $A_x,A_z,B_x,B_z$ are given then $$\angle{ACB}=\arctan\dfrac{B_z}{B_x}$$
Similarly, $$\angle{ECD}=\arctan\dfrac{A_x}{A_z}$$
and $$\angle{ECD}=90^{\circ}$$
So,$$\theta=360^{\circ}-(90^{\circ}+\arctan\dfrac{B_z}{B_x}+\arctan\dfrac{A_x}{A_z})$$
{"set_name": "stack_exchange", "score": 0, "question_id": 2917126}