ECE595 / micropython

MicroPython - a lean and efficient Python implementation for microcontrollers and constrained systems
https://micropython.org
Other
0 stars 1 forks source link

math.hypot(*coordinates) support for n-dimensional points #19

Open Leah1115 opened 2 years ago

Leah1115 commented 2 years ago

math.hypot(*coordinates) 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(xx + yy).

Changed in version 3.8: Added support for n-dimensional points. Formerly, only the two dimensional case was supported.