How to Find Pythagorean Triples for a Right Triangle with a Given Angle

algebra-precalculuspythagorean triplestrianglestrigonometry

Given an angle $\theta$, can I find a Pythagorean triple $(A,B,C)$ such that the corresponding right triangle contains an angle that is as close to $\theta$ as I want? And if so, how? For example suppose $\theta = 56.25^\circ$. How do I find Pythagorean triples $(A,B,C)$ such that $\tan(56.25^\circ) \approx B/A$? Looking at Euclid's formula this is the same as asking for coprime not-both-odd integers $m$ and $n$ such that $$\tan(56.25^\circ) \approx \frac{2mn}{m^2-n^2}\,$$ but this only makes a brute-force search easier. Is there a procedural way to generate such arbitrarily precise triples?

Best Answer

Let $r\in[0,\infty)$. The problem posed is equivalent to finding $m\geq n\in\mathbb N$ such that $r\sim\frac{2mn}{m^2-n^2}$.

Thus, we want $$rm^2-2mn-rn^2\sim0$$Now suppose $r,n$ is given and we want to find $m$ that satisfies the equation above (not necessarily natural).

Thus, $$m=\frac{n\left(1+\sqrt{1+r^2}\right)}r$$So, we want to find a choice of $n$ that makes the expression above arbitrarily close to an integer.

But that's relatively easy. Let $c=\frac r{1+\sqrt{1+r^2}}$. Thus, $n=mc$. So, we just want to find a fraction $\frac nm$ close to $c$. Easy!

Summary:

Given $\theta$, compute $$c=\frac{\sin\theta}{1+\cos\theta} = \tan\frac\theta2$$Then, find a fraction $\frac nm$ arbitrarily close to $c$. Substitute $m,n$ into your formula and voila!