This works only for Pythagorean triples or for triangles "similar" to Pythagorean triples. If $\space d \space$ is not an odd integer, round to an odd integer greater than $\space 1 \space$and then multiply or divide all sides (as needed) by
$\space \dfrac{d}{\text{rounded-number}}$ after the following calculations are complete.
Assuming Pythagorean triples where all sides are integers, we begin with the Pythagorean theorem where
$\space A^2+B^2=C^2\space $ and Euclid's formula where
$\space A=m^2-k^2 \quad B=2mk\quad C=m^2+k^2.\quad$
From your diagram we let the $x$-coordinate be $\space d=A.\quad$ For any primitiive Pythagorean triple, $\space A=2x+1, x\in\mathbb{N}\space$ and, for each $A$-value, there are
$2^{n-1}$ primitive triples where $\space n\space$ is the number of distinct prime factors of $\space A.\quad$
We can find all of these triples by solving the
$A$-function for $\space k\space$ and testing a defined range of $m$-values to see which yield integers. Note that there may be additional triples found if they are odd square multiples of primitives.
Let us begin
$$A=m^2-k^2\implies k=\sqrt{m^2-A}\\
\text{for}\qquad \sqrt{A+1} \le m \le \frac{A+1}{2}$$
The lower limit ensures $k\in\mathbb{N}$ and the upper limit ensures $m> k$.
$$A=3\cdot 5=15\implies \sqrt{15+1}=4\le m \le \frac{15+1}{2} =8\\
\text{and we find}\quad
\sqrt{4^2-15}=1,\space \sqrt{8^2-15}=7\\
i.e. \space m\in\{4,8\}\implies k \in\{1,7\} $$
$$F(4,1)=(15,8,17)\qquad \qquad F(8,7)=(15,112,113) $$
Here, there are $2^{2-1}=2$ triples where $a=8$ or $a=112$ and $AD$ is either $17$ or $113$.
In this case,
$\space \theta\approx 28.1^\circ\space$
0r
$\space \theta\approx 82.4^\circ\space$
If you happen to know an angle, you can find the closest matching Pythagorean triple using techiques described
here.