Generating Pythagorean Triples

JavaScript allows you to make web pages interactive by manipulating user inputted data.
This tutorial shows how to collect data from an input field and use it to generate Pythagorean triples.
The result is then displayed to user.

How to generate Pythagorean triples

Take two positive integers x, y with x > y.
A Pythagorean triple is of the form x2 - y2, 2xy, x2 + y2.