In mathematics, Pythagorean addition is a binary operation on the that computes the length of the hypotenuse of a right triangle, given its two sides. Like the more familiar addition and multiplication operations of arithmetic, it is both associative and commutative.
This operation can be used in the conversion of Cartesian coordinates to polar coordinates, and in the calculation of Euclidean distance. It also provides a simple notation and terminology for the diameter of a cuboid, the energy-momentum relation in physics, and the overall noise from independent sources of noise. In its applications to signal processing and propagation of measurement uncertainty, the same operation is also called addition in quadrature. A scaled version of this operation gives the quadratic mean or root mean square.
It is implemented in many programming libraries as the hypot function, in a way designed to avoid errors arising due to limited-precision calculations performed on computers. Donald Knuth has written that "Most of the square root operations in computer programs could probably be avoided if Pythagorean were more widely available, because people seem to want square roots primarily when they are computing distances."
Pythagorean addition can also find the length of an interior diagonal of a rectangle or rectangular cuboid. For a rectangle with sides and , the diagonal length is . For a cuboid with side lengths , , and , the length of a body diagonal is .
The standard deviation of a collection of observations is the quadratic mean of their individual deviations from the mean. When two or more independent random variables are added, the standard deviation of their sum is the Pythagorean sum of their standard deviations. Thus, the Pythagorean sum itself can be interpreted as giving the amount of overall noise when combining independent sources of noise.
If the engineering tolerances of different parts of an assembly are treated as independent noise, they can be combined using a Pythagorean sum. In experimental sciences such as physics, addition in quadrature is often used to combine different sources of measurement uncertainty. However, this method of propagation of uncertainty applies only when there is no correlation between sources of uncertainty, and it has been criticized for conflating experimental noise with .
When combining signals, it can be a useful design technique to arrange for the combined signals to be Orthogonality in polarization or phase, so that they add in quadrature. In early radio engineering, this idea was used to design directional antennas, allowing signals to be received while nullifying the interference from signals coming from other directions. When the same technique is applied in software to obtain a directional signal from a radio or ultrasound phased array, Pythagorean addition may be used to combine the signals. Other recent applications of this idea include improved efficiency in the frequency conversion of .
In the psychophysics of haptic perception, Pythagorean addition has been proposed as a model for the perceived intensity of vibration when two kinds of vibration are combined.
In image processing, the Sobel operator for edge detection consists of a convolution step to determine the gradient of an image followed by a Pythagorean sum at each pixel to determine the magnitude of the gradient.
Although many modern implementations of this operation instead compute Pythagorean sums by reducing the problem to the square root function, they do so in a way that has been designed to avoid errors arising from the limited-precision calculations performed on computers. If calculated using the natural formula, the squares of very large or small values of and may exceed the range of machine precision when calculated on a computer. This may to an inaccurate result caused by arithmetic underflow and overflow, although when overflow and underflow do not occur the output is within two ulp of the exact result. Common implementations of the hypot function rearrange this calculation in a way that avoids the problem of overflow and underflow and are even more precise.
If either input to hypot is infinite, the result is infinite. Because this is true for all possible values of the other input, the IEEE 754 floating-point standard requires that this remains true even when the other input is not a number (NaN).
The computation of cannot overflow unless both and are zero. If underflows, the final result is equal to , which is correct within the precision of the calculation. The square root is computed of a value between 1 and 2. Finally, the multiplication by cannot underflow, and overflows only when the result is too large to represent.
One drawback of this rearrangement is the additional division by , which increases both the time and inaccuracy of the computation. More complex implementations avoid these costs by dividing the inputs into more cases:
Metafont has Pythagorean addition and subtraction as built-in operations, under the symbols ++ and +-+ respectively.
The terms "Pythagorean addition" and "Pythagorean sum" for this operation have been used at least since the 1950s, and its use in signal processing as "addition in quadrature" goes back at least to 1919.
From the 1920s to the 1940s, before the widespread use of computers, multiple designers of included square-root scales in their devices, allowing Pythagorean sums to be calculated mechanically. Researchers have also investigated for approximating the value of Pythagorean sums.
|
|