summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorRaymond Hettinger <rhettinger@users.noreply.github.com>2018-07-28 14:48:04 (GMT)
committerGitHub <noreply@github.com>2018-07-28 14:48:04 (GMT)
commitc6dabe37e3c4d449562182b044184d1756bea037 (patch)
treebbb89623d68962192e810c5327ae98ff28084025 /Doc
parent50326927465c3f5c6c0168fc43310c8e97db0a47 (diff)
downloadcpython-c6dabe37e3c4d449562182b044184d1756bea037.zip
cpython-c6dabe37e3c4d449562182b044184d1756bea037.tar.gz
cpython-c6dabe37e3c4d449562182b044184d1756bea037.tar.bz2
bpo-33089: Multidimensional math.hypot() (GH-8474)
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/math.rst15
1 files changed, 12 insertions, 3 deletions
diff --git a/Doc/library/math.rst b/Doc/library/math.rst
index 33aec57..e60d029 100644
--- a/Doc/library/math.rst
+++ b/Doc/library/math.rst
@@ -330,10 +330,19 @@ Trigonometric functions
Return the cosine of *x* radians.
-.. function:: hypot(x, y)
+.. function:: hypot(*coordinates)
- Return the Euclidean norm, ``sqrt(x*x + y*y)``. This is the length of the vector
- from the origin to point ``(x, y)``.
+ Return the Euclidean norm, ``sqrt(sum(x**2 for x in coordinates))``.
+ This is the length of the vector from the origin to the point
+ given by the coordinates.
+
+ For a two dimensional point ``(x, y)``, this is equivalent to computing
+ the hypotenuse of a right triangle using the Pythagorean theorem,
+ ``sqrt(x*x + y*y)``.
+
+ .. versionchanged:: 3.8
+ Added support for n-dimensional points. Formerly, only the two
+ dimensional case was supported.
.. function:: sin(x)