Pythagorean Triples

Drag the sliders to test different values of m. Notice that no matter what, the result is a triangle with all integers sides!

Why do you think this rule works?