Why this comes up constantly in machining
Right triangles hide inside more CNC problems than they first appear to: figuring out a compound angle on a fixture, working out the offset needed to reach a feature on an angled surface, laying out a tapered pocket, or checking a drawing dimension that was given as two legs instead of a direct measurement. Rather than looking up the trig relationships each time, this solves the full triangle from just the two known sides.
How the numbers are calculated
The hypotenuse comes from the Pythagorean theorem, the square root of side A squared plus side B squared. The angle opposite side A is the arctangent of A divided by B, and the angle opposite side B is simply 90 degrees minus that first angle, since the two non-right angles in a right triangle always add up to 90 degrees.
Practical tips
Keep side A and side B consistent with how your drawing or setup actually measures them, since swapping which leg is which will swap which angle comes out of which calculation. This same math applies whether you are solving for a physical triangle on a part or working out clearance and offset distances in a program, since a right triangle relationship is a right triangle relationship regardless of what it represents.
