2018-06-16 15:39:07 +02:00

50 lines
1.4 KiB
Markdown

---
layout: default
---
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
<h1 id="function-hypot">Function hypot <a href="#function-hypot" title="Permalink">#</a></h1>
Calculate the hypotenusa of a list with values. The hypotenusa is defined as:
hypot(a, b, c, ...) = sqrt(a^2 + b^2 + c^2 + ...)
For matrix input, the hypotenusa is calculated for all values in the matrix.
<h2 id="syntax">Syntax <a href="#syntax" title="Permalink">#</a></h2>
```js
math.hypot(a, b, ...)
math.hypot([a, b, c, ...])
```
<h3 id="parameters">Parameters <a href="#parameters" title="Permalink">#</a></h3>
Parameter | Type | Description
--------- | ---- | -----------
`args` | ... number &#124; BigNumber &#124; Array &#124; Matrix | A list with numeric values or an Array or Matrix. Matrix and Array input is flattened and returns a single number for the whole matrix.
<h3 id="returns">Returns <a href="#returns" title="Permalink">#</a></h3>
Type | Description
---- | -----------
number &#124; BigNumber | Returns the hypothenusa of the input values.
<h2 id="examples">Examples <a href="#examples" title="Permalink">#</a></h2>
```js
math.hypot(3, 4) // 5
math.hypot(3, 4, 5) // 7.0710678118654755
math.hypot([3, 4, 5]) // 7.0710678118654755
math.hypot(-2) // 2
```
<h2 id="see-also">See also <a href="#see-also" title="Permalink">#</a></h2>
[abs](abs.html),
[norm](norm.html)