Returns the hypotenuse Ö(a2 + b2), i.e. the positive square root of the sum of Value a square and Value b square.
Syntax
HYP(Value a, Value b)
Input
Value a | is a value |
Domain type: | any Value domain |
Value b | is a value |
Domain type: | any Value domain |
Output
HYP returns: | a real value |
Domain: | system domain Value |
Value range: | >=0 |
Note:
When one of the input parameters is undefined, or when both input parameters are undefined, the output will also be undefined.
Tips:
Usable in
MapCalc, TabCalc, Simple calculators
Examples
Pocket line calculator examples:
? HYP(1,1) |
returns 1.4142, i.e. Ö2 |
? HYP(3,4) |
returns 5.0000 |
MapCalc example:
OutMap = HYP(InMapA,InMapB)
MapA |
MapB |
OutMap |
|||||||||||||||||||||||||||
|
|
|
TabCalc example:
OutCol = HYP(InColA,InColB)
InColA |
InColB |
OutCol |
1 |
1 |
1.4142 |
2 |
2 |
2.8284 |
3 |
4 |
5.0000 |
-2 |
3 |
3.6056 |
0 |
1 |
1.0000 |
? |
8 |
? |
? |
9 |
? |
4 |
6 |
7.2111 |
-9 |
0 |
9.0000 |
Applied example: calculation of slope values in percentages
The exponential HYP function can for instance be used to calculate slope values in percentages, from 2 input maps which contain heigth differences in x-direction (map DX) and in y-direction (map DY).
DX |
DY |
Slopepct |
|||||||||||||||||||||||||||
|
|
|
Slopepct = (HYP(DX,DY)/PIXSIZE(DX)) * 100
PIXSIZE(DX) is a function which retrieves the pixel size of map DX. You can also directly fill out the pixel size of the input maps yourself (in this case 20). The results may exceed 100%, as a slope of 45° is equal to 100%.
See also: