On this page
  1. math.hypot
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

math.hypot

Prev: math.gcd | Up: math | Next: math.isclose
Rel: math.acos, math.acosh, math.asin, math.asinh
Ref: docs.python.org — math.hypot
Tags: #public #python3 #stdlib #math


Import

import math
from math import hypot

Signature & Overview

math.hypot(*coordinates)

Multidimensional Euclidean distance from the origin to a point.

Usage

import math

assert math.isclose(math.hypot(3, 4), 5.0)
assert math.isclose(math.hypot(2, 3, 6), 7.0)

Gotchas

REPL Inspect

from math import hypot
help(hypot)

Linked from

Related notes