numpy.hypot

numpy.hypot(x1, x2[, out])

Given two sides of a right triangle, return its hypotenuse.

Parameters:

x : array_like

Base of the triangle.

y : array_like

Height of the triangle.

Returns:

z : ndarray

Hypotenuse of the triangle: sqrt(x**2 + y**2)

Examples

>>> np.hypot(3,4)
5.0

Previous topic

numpy.arctan

Next topic

numpy.arctan2

This Page

Quick search